// Dissect the cb Handler's signature
978983
func argInfo(cb Handler) (reflect.Type, int) {
	cbType := reflect.TypeOf(cb)
	if cbType.Kind() != reflect.Func {
		panic("nats: Handler needs to be a func")
	}
	numArgs := cbType.NumIn()
	if numArgs == 0 {
		return nil, numArgs
	}
	return cbType.In(numArgs - 1), numArgs
}
1239640
func (c *Ctx) Decrypt(sh SessionHandle, cipher []byte) ([]byte, error) {
	var (
		plain    C.CK_BYTE_PTR
		plainlen C.CK_ULONG
	)
	e := C.Decrypt(c.ctx, C.CK_SESSION_HANDLE(sh), cMessage(cipher), C.CK_ULONG(len(cipher)), &plain, &plainlen)
	if toError(e) != nil {
		return nil, toError(e)
	}
	s := C.GoBytes(unsafe.Pointer(plain), C.int(plainlen))
	C.free(unsafe.Pointer(plain))
	return s, nil
}
1211426
func deDeploySysCC(chainID string, ccprov ccprovider.ChaincodeProvider, syscc SelfDescribingSysCC) error {
	// XXX This is an ugly hack, version should be tied to the chaincode instance, not he peer binary
	version := util.GetSysCCVersion()

	ccci := &ccprovider.ChaincodeContainerInfo{
		Type:          "GOLANG",
		Name:          syscc.Name(),
		Path:          syscc.Path(),
		Version:       version,
		ContainerType: inproccontroller.ContainerType,
	}

	err := ccprov.Stop(ccci)

	return err
}
764346
func CmdlineHandler() gin.HandlerFunc {
	return func(ctx *gin.Context) {
		pprof.Cmdline(ctx.Writer, ctx.Request)
	}
}
645903
func InspectGrant(c context.Context, certs tokensigning.CertificatesSupplier, tok string) (*tokensigning.Inspection, error) {
	i := tokensigning.Inspector{
		Certificates:   certs,
		SigningContext: tokenSigningContext,
		Envelope:       func() proto.Message { return &tokenserver.OAuthTokenGrantEnvelope{} },
		Body:           func() proto.Message { return &tokenserver.OAuthTokenGrantBody{} },
		Unwrap: func(e proto.Message) tokensigning.Unwrapped {
			env := e.(*tokenserver.OAuthTokenGrantEnvelope)
			return tokensigning.Unwrapped{
				Body:         env.TokenBody,
				RsaSHA256Sig: env.Pkcs1Sha256Sig,
				KeyID:        env.KeyId,
			}
		},
		Lifespan: func(b proto.Message) tokensigning.Lifespan {
			body := b.(*tokenserver.OAuthTokenGrantBody)
			issuedAt := google.TimeFromProto(body.IssuedAt)
			return tokensigning.Lifespan{
				NotBefore: issuedAt,
				NotAfter:  issuedAt.Add(time.Duration(body.ValidityDuration) * time.Second),
			}
		},
	}
	return i.InspectToken(c, tok)
}
211879
func newScanStringHandler(s *string) replyHandler {
	return func(reply interface{}) error {
		if s == nil {
			return fmt.Errorf("jobs: Error in newScanStringHandler: expected arg s to be a pointer to a string but it was nil")
		}
		var err error
		(*s), err = redis.String(reply, nil)
		if err != nil {
			return fmt.Errorf("jobs: Error in newScanStringHandler: %s", err.Error())
		}
		return nil
	}
}
1293970
func (h *Handler) Discovery(base string) *camtypes.SignDiscovery {
	sd := &camtypes.SignDiscovery{
		PublicKeyID:   h.entity.PrimaryKey.KeyIdString(),
		SignHandler:   base + "camli/sig/sign",
		VerifyHandler: base + "camli/sig/verify",
	}
	if h.pubKeyBlobRef.Valid() {
		sd.PublicKeyBlobRef = h.pubKeyBlobRef
		sd.PublicKey = base + h.pubKeyBlobRefServeSuffix
	}
	return sd
}
131616
func FindEach(top *Node, expr string, cb func(int, *Node)) {
	for i, n := range Find(top, expr) {
		cb(i, n)
	}
}
174766
func (handle *ContextHandle) Decrypt(session mPkcs11.SessionHandle, cypher []byte) ([]byte, error) {

	handle.lock.RLock()
	defer handle.lock.RUnlock()

	return handle.ctx.Decrypt(session, cypher)
}
361261
func PrefixDetector(prefix string, handler Handler) Detector {
	return Detector{
		Needed:  len([]byte(prefix)),
		Test:    func(b []byte) bool { return string(b) == prefix },
		Handler: handler,
	}
}
445109
func (e *defaultStoreEnumerator) Inspect(ids []string) ([]*api.Volume, error) {
	volumes := make([]*api.Volume, 0, len(ids))
	for _, id := range ids {
		volume, err := e.GetVol(id)
		// XXX Distinguish between ENOENT and an internal error from KVDB
		if err != nil {
			continue
		}
		volumes = append(volumes, volume)
	}
	return volumes, nil
}
1149236
func (d DirectDecrypt) Decrypt() ([]byte, error) {
	cek := make([]byte, len(d.Key))
	copy(cek, d.Key)
	return cek, nil
}
227215
func (p *gc_parser) parse_func_decl() (string, *ast.FuncDecl) {
	// "func" was already consumed by lookahead
	name := p.parse_exported_name()
	typ := p.parse_signature()
	if p.tok == '{' {
		p.parse_func_body()
	}
	return name.X.(*ast.Ident).Name, &ast.FuncDecl{
		Name: name.Sel,
		Type: typ,
	}
}
36046
func newDisseminator(n *Node) *disseminator {
	d := &disseminator{
		node:                n,
		changes:             make(map[string]*pChange),
		maxP:                defaultPFactor,
		pFactor:             defaultPFactor,
		logger:              logging.Logger("disseminator").WithField("local", n.Address()),
		reverseFullSyncJobs: make(chan struct{}, n.maxReverseFullSyncJobs),
	}

	return d
}
75940
func initParser() {
	if cache == nil {
		log.Info("Initializing dissection cache...")

		cache = &parserCache{
			decoded: []gopacket.LayerType{},
		}

		parser = gopacket.NewDecodingLayerParser(
			layers.LayerTypeEthernet,
			&cache.eth, &cache.ip4, &cache.ip6,
			&cache.icmp4, &cache.icmp6, &cache.tcp, &cache.udp)
	}
}
1003973
func (v *Volume) Inspect(ctx context.Context) (types.Volume, error) {
	return v.client.VolumeInspect(ctx, v.fullName())
}
255353
func InspectToken(c context.Context, certs tokensigning.CertificatesSupplier, tok string) (*tokensigning.Inspection, error) {
	i := tokensigning.Inspector{
		Certificates:   certs,
		SigningContext: tokenSigningContext,
		Envelope:       func() proto.Message { return &messages.DelegationToken{} },
		Body:           func() proto.Message { return &messages.Subtoken{} },
		Unwrap: func(e proto.Message) tokensigning.Unwrapped {
			env := e.(*messages.DelegationToken)
			return tokensigning.Unwrapped{
				Body:         env.SerializedSubtoken,
				RsaSHA256Sig: env.Pkcs1Sha256Sig,
				KeyID:        env.SigningKeyId,
			}
		},
		Lifespan: func(b proto.Message) tokensigning.Lifespan {
			body := b.(*messages.Subtoken)
			return tokensigning.Lifespan{
				NotBefore: time.Unix(body.CreationTime, 0),
				NotAfter:  time.Unix(body.CreationTime+int64(body.ValidityDuration), 0),
			}
		},
	}
	return i.InspectToken(c, tok)
}