// ExtendSecp adds n more secp256k1 keys (to remove, just take a slice).
770841
func (pkz privKeys) ExtendSecp(n int) privKeys {
	extra := GenSecpPrivKeys(n)
	return append(pkz, extra...)
}
83707
func AESEncryptWithECB(str, key []byte) ([]byte, error) {
	cb, err := aes.NewCipher(key)
	if err != nil {
		return nil, errors.Trace(err)
	}
	mode := newECBEncrypter(cb)
	return aesEncrypt(str, mode)
}
806984
func (parser *Parser) parseTypeExpr(pkgName, typeName string, typeExpr ast.Expr) (spec.Schema, error) {
	//TODO: return pointer to spec.Schema

	switch expr := typeExpr.(type) {
	// type Foo struct {...}
	case *ast.StructType:
		refTypeName := fullTypeName(pkgName, typeName)
		if schema, isParsed := parser.swagger.Definitions[refTypeName]; isParsed {
			return schema, nil
		}

		extraRequired := make([]string, 0)
		properties := make(map[string]spec.Schema)
		for _, field := range expr.Fields.List {
			var fieldProps map[string]spec.Schema
			var requiredFromAnon []string
			if field.Names == nil {
				var err error
				fieldProps, requiredFromAnon, err = parser.parseAnonymousField(pkgName, field)
				if err != nil {
					return spec.Schema{}, err
				}
				extraRequired = append(extraRequired, requiredFromAnon...)
			} else {
				var err error
				fieldProps, err = parser.parseStruct(pkgName, field)
				if err != nil {
					return spec.Schema{}, err
				}
			}

			for k, v := range fieldProps {
				properties[k] = v
			}
		}

		// collect requireds from our properties and anonymous fields
		required := parser.collectRequiredFields(pkgName, properties, extraRequired)

		// unset required from properties because we've collected them
		for k, prop := range properties {
			tname := prop.SchemaProps.Type[0]
			if tname != "object" {
				prop.SchemaProps.Required = make([]string, 0)
			}
			properties[k] = prop
		}

		return spec.Schema{
			SchemaProps: spec.SchemaProps{
				Type:       []string{"object"},
				Properties: properties,
				Required:   required,
			}}, nil

	// type Foo Baz
	case *ast.Ident:
		refTypeName := fullTypeName(pkgName, expr.Name)
		if _, isParsed := parser.swagger.Definitions[refTypeName]; !isParsed {
			if typedef, ok := parser.TypeDefinitions[pkgName][expr.Name]; ok {
				parser.ParseDefinition(pkgName, expr.Name, typedef)
			}
		}
		return parser.swagger.Definitions[refTypeName], nil

	// type Foo *Baz
	case *ast.StarExpr:
		return parser.parseTypeExpr(pkgName, typeName, expr.X)

	// type Foo []Baz
	case *ast.ArrayType:
		itemSchema, err := parser.parseTypeExpr(pkgName, "", expr.Elt)
		if err != nil {
			return spec.Schema{}, err
		}
		return spec.Schema{
			SchemaProps: spec.SchemaProps{
				Type: []string{"array"},
				Items: &spec.SchemaOrArray{
					Schema: &itemSchema,
				},
			},
		}, nil

	// type Foo pkg.Bar
	case *ast.SelectorExpr:
		if xIdent, ok := expr.X.(*ast.Ident); ok {
			pkgName = xIdent.Name
			typeName = expr.Sel.Name
			refTypeName := fullTypeName(pkgName, typeName)
			if _, isParsed := parser.swagger.Definitions[refTypeName]; !isParsed {
				typedef := parser.TypeDefinitions[pkgName][typeName]
				parser.ParseDefinition(pkgName, typeName, typedef)
			}
			return parser.swagger.Definitions[refTypeName], nil
		}

	// type Foo map[string]Bar
	case *ast.MapType:
		itemSchema, err := parser.parseTypeExpr(pkgName, "", expr.Value)
		if err != nil {
			return spec.Schema{}, err
		}
		return spec.Schema{
			SchemaProps: spec.SchemaProps{
				Type: []string{"object"},
				AdditionalProperties: &spec.SchemaOrBool{
					Schema: &itemSchema,
				},
			},
		}, nil
	// ...
	default:
		Printf("Type definition of type '%T' is not supported yet. Using 'object' instead.\n", typeExpr)
	}

	return spec.Schema{
		SchemaProps: spec.SchemaProps{
			Type: []string{"object"},
		},
	}, nil
}
228531
func extendable(p interface{}) (extendableProto, error) {
	switch p := p.(type) {
	case extendableProto:
		if isNilPtr(p) {
			return nil, fmt.Errorf("proto: nil %T is not extendable", p)
		}
		return p, nil
	case extendableProtoV1:
		if isNilPtr(p) {
			return nil, fmt.Errorf("proto: nil %T is not extendable", p)
		}
		return extensionAdapter{p}, nil
	}
	// Don't allocate a specific error containing %T:
	// this is the hot path for Clone and MarshalText.
	return nil, errNotExtendable
}
394152
func EncodeExtendedAttributes(eas []ExtendedAttribute) ([]byte, error) {
	var buf bytes.Buffer
	for i := range eas {
		last := false
		if i == len(eas)-1 {
			last = true
		}

		err := writeEa(&buf, &eas[i], last)
		if err != nil {
			return nil, err
		}
	}
	return buf.Bytes(), nil
}
1249477
func Aes256ECBDecrypt(key [32]byte, ciphertext []byte) (plaintext []byte, err error) {
	return aesECBDec(key[:], ciphertext)
}
1196547
func RegisteredExtensions(pb Message) map[int32]*ExtensionDesc {
	return extensionMaps[reflect.TypeOf(pb).Elem()]
}
200091
func (f *Field) Exp(e int) byte {
	if e < 0 {
		return 0
	}
	return f.exp[e%255]
}
178206
func Convert_v1alpha2_EtcdManagerSpec_To_kops_EtcdManagerSpec(in *EtcdManagerSpec, out *kops.EtcdManagerSpec, s conversion.Scope) error {
	return autoConvert_v1alpha2_EtcdManagerSpec_To_kops_EtcdManagerSpec(in, out, s)
}
798165
func (s *CountService) LowercaseExpandedTerms(lowercaseExpandedTerms bool) *CountService {
	s.lowercaseExpandedTerms = &lowercaseExpandedTerms
	return s
}
720487
func (k EncodedKey) Cmp(another EncodedKey) int {
	return bytes.Compare(k, another)
}
1080431
func encodeRegexp(buf *bytes.Buffer, name string, val Regexp) error {
	// type
	if err := buf.WriteByte(_REGEXP); err != nil {
		return err
	}

	// name
	if err := writeCstring(buf, name); err != nil {
		return err
	}

	// regex
	if err := writeCstring(buf, val.Pattern); err != nil {
		return err
	}

	// options
	return writeCstring(buf, val.Options)
}
124722
func (e *XXX_InternalExtensions) extensionsRead() (map[int32]Extension, sync.Locker) {
	if e.p == nil {
		return nil, nil
	}
	return e.p.extensionMap, &e.p.mu
}
1102577
func (self *Query) extendQuery(mgoQuery *mgo.Query) {

	if self.selector != nil {
		mgoQuery.Select(self.selector)
	}

	if len(self.sort) > 0 {
		mgoQuery.Sort(self.sort...)
	}

	if self.limit != 0 {
		mgoQuery.Limit(self.limit)
	}

	if self.skip != 0 {
		mgoQuery.Skip(self.skip)
	}
}
1301449
func NewECPublicKey(b []byte) *ECPublicKey {
	ensureKeyLength(b)
	k := &ECPublicKey{}
	copy(k.key[:], b)
	return k
}
235708
func (p *ListParams) AddExpand(f string) {
	p.Expand = append(p.Expand, &f)
}
921705
func Aes256ECBEncrypt(key [32]byte, plaintext []byte) (ciphertext []byte, err error) {
	return aesECBEnc(key[:], plaintext)
}