// NewRekeyFSM creates a new rekey FSM.
187916
func NewRekeyFSM(fbo *folderBranchOps) RekeyFSM {
	fsm := &rekeyFSM{
		reqs:       make(chan RekeyEvent, fbo.config.Mode().RekeyQueueSize()),
		shutdownCh: make(chan struct{}),
		fbo:        fbo,
		log:        fbo.config.MakeLogger("RekeyFSM"),

		listeners: make(map[rekeyEventType][]rekeyFSMListener),
	}
	fsm.current = newRekeyStateIdle(fsm)
	if fbo.bType == standard {
		go fsm.loop()
	}
	return fsm
}
1043404
func (u *User) NewKey() (res handlers.Big, err error) {
	defer func() {
		if r := recover(); r != nil {
			res = nil
			err = errors.Errorf("failure [%s]", r)
		}
	}()

	res = &Big{E: cryptolib.RandModOrder(u.NewRand())}

	return
}
757291
func (p *Provider) NewVM() container.VM {
	return NewDockerVM(p.PeerID, p.NetworkID, p.BuildMetrics)
}
837684
func NewKVRead(key string, version *version.Height) *kvrwset.KVRead {
	return &kvrwset.KVRead{Key: key, Version: newProtoVersion(version)}
}
201504
func NewRekeyQueueStandard(config Config) (rkq *RekeyQueueStandard) {
	ctx, cancel := context.WithCancel(context.Background())
	rkq = &RekeyQueueStandard{
		config:   config,
		log:      config.MakeLogger("RQ"),
		queue:    make(chan tlf.ID, config.Mode().RekeyQueueSize()),
		limiter:  rate.NewLimiter(rekeysPerSecond, numConcurrentRekeys),
		pendings: make(map[tlf.ID]bool),
		cancel:   cancel,
	}
	if config.Mode().RekeyWorkers() > 0 {
		rkq.start(ctx)
	}
	return rkq
}
535302
func (s *UpdateCustomKeyStoreInput) SetNewCustomKeyStoreName(v string) *UpdateCustomKeyStoreInput {
	s.NewCustomKeyStoreName = &v
	return s
}
1363366
func PrecomputeKeys(count int) KeygenOption {
	return func(k *Keygen) error {
		k.precomputeCount = count
		return nil
	}
}
947919
func NewPopulatedNwkSKey(r Rand) (key *NwkSKey) {
	key = &NwkSKey{}
	if _, err := randRead(r, key[:]); err != nil {
		panic(fmt.Errorf("types.NewPopulatedNwkSKey: %s", err))
	}
	return
}
596872
func NewPSSParams(hashAlg, mgf, saltLength uint) []byte {
	p := C.CK_RSA_PKCS_PSS_PARAMS{
		hashAlg: C.CK_MECHANISM_TYPE(hashAlg),
		mgf:     C.CK_RSA_PKCS_MGF_TYPE(mgf),
		sLen:    C.CK_ULONG(saltLength),
	}
	return C.GoBytes(unsafe.Pointer(&p), C.int(unsafe.Sizeof(p)))
}
1232429
func (s *EntityRecognizerProperties) SetVolumeKmsKeyId(v string) *EntityRecognizerProperties {
	s.VolumeKmsKeyId = &v
	return s
}
701759
func (rs *ReducerStruct) NewKey() sophie.Sophier {
	if rs.NewKeyF != nil {
		return rs.NewKeyF()
	}
	return new(sophie.RawByteSlice)
}
924701
func NewFxOnewayYARPCProcedures() interface{} {
	return func(params FxOnewayYARPCProceduresParams) FxOnewayYARPCProceduresResult {
		return FxOnewayYARPCProceduresResult{
			Procedures: BuildOnewayYARPCProcedures(params.Server),
			ReflectionMeta: reflection.ServerMeta{
				ServiceName:     "uber.yarpc.internal.crossdock.Oneway",
				FileDescriptors: yarpcFileDescriptorClosure6acfd671bab786d8,
			},
		}
	}
}
920766
func (c *Client) NewListKeysRequest(bucket string) *RpbListKeysReq {
	return &RpbListKeysReq{
		Bucket: []byte(bucket),
	}
}
666015
func tagKeysIam(ts []*iam.Tag) []*string {
	result := make([]*string, 0, len(ts))
	for _, t := range ts {
		result = append(result, t.Key)
	}
	return result
}
1145456
func NewDefaultingCodecForScheme(
	// TODO: I should be a scheme interface?
	scheme *runtime.Scheme,
	encoder runtime.Encoder,
	decoder runtime.Decoder,
	encodeVersion runtime.GroupVersioner,
	decodeVersion runtime.GroupVersioner,
) runtime.Codec {
	return NewCodec(encoder, decoder, runtime.UnsafeObjectConvertor(scheme), scheme, scheme, scheme, encodeVersion, decodeVersion, scheme.Name())
}
833360
func (r RaftDEKData) UpdateKEK(oldKEK, candidateKEK ca.KEKData) ca.PEMKeyHeaders {
	if _, unlockedToLocked, err := compareKEKs(oldKEK, candidateKEK); err == nil && unlockedToLocked {
		return RaftDEKData{
			EncryptionKeys: r.EncryptionKeys,
			NeedsRotation:  true,
			FIPS:           r.FIPS,
		}
	}
	return r
}
53692
func newFormatFSV1() (format *formatFSV1) {
	f := &formatFSV1{}
	f.Version = formatMetaVersionV1
	f.Format = formatBackendFS
	f.ID = mustGetUUID()
	f.FS.Version = formatFSVersionV1
	return f
}