// Verify fetches the block with the given key from the Filemanager
// of the given Filestore and returns a ListRes object with the information.
// Verify makes sure that the reference is valid and the block data can be
// read.
515859
func Verify(fs *Filestore, key cid.Cid) *ListRes {
	return list(fs, true, key)
}
416777
func (lu *LookupUnique) Verify(vcursor VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) {
	if lu.writeOnly {
		out := make([]bool, len(ids))
		for i := range ids {
			out[i] = true
		}
		return out, nil
	}
	return lu.lkp.Verify(vcursor, ids, ksidsToValues(ksids))
}
692623
func (h *PBKDF2Hasher) Verify(password string, encoded string) (bool, error) {
	s := strings.Split(encoded, "$")

	if len(s) != 4 {
		return false, ErrHashComponentMismatch
	}

	algorithm, iterations, salt := s[0], s[1], s[2]

	if algorithm != h.Algorithm {
		return false, ErrAlgorithmMismatch
	}

	i, err := strconv.Atoi(iterations)

	if err != nil {
		return false, ErrHashComponentUnreadable
	}

	newencoded, err := h.Encode(password, salt, i)

	if err != nil {
		return false, err
	}

	return hmac.Equal([]byte(newencoded), []byte(encoded)), nil
}
488630
func (p *tokenManager) Verify(token []byte) (*DatapathKey, error) {

	tokenString := string(token)
	if pk, err := p.keycache.Get(tokenString); err == nil {
		return pk.(*DatapathKey), err
	}

	claims := &verifierClaims{}
	var JWTToken *jwt.Token
	var err error
	for _, pk := range p.publicKeys {

		if pk == nil {
			continue
		}

		JWTToken, err = jwt.ParseWithClaims(tokenString, claims, func(_ *jwt.Token) (interface{}, error) { // nolint
			return pk, nil
		})
		if err != nil || !JWTToken.Valid {
			continue
		}

		dp := &DatapathKey{
			PublicKey: KeyFromClaims(claims),
			Tags:      claims.Tags,
		}

		if time.Now().Add(p.validity).Unix() <= claims.ExpiresAt {
			p.keycache.AddOrUpdate(tokenString, dp)
		}
		return dp, nil
	}

	return nil, errors.New("unable to verify token against any available public key")
}
1120512
func Verify(id string, digits []byte) bool {
	if digits == nil || len(digits) == 0 {
		return false
	}
	reald := globalStore.Get(id, true)
	if reald == nil {
		return false
	}
	return bytes.Equal(digits, reald)
}
525221
func (v *Verifier) Verify() error {
	if v.Identity == nil {
		return fmt.Errorf("no identity document to verify")
	}

	if v.Signature == nil {
		return fmt.Errorf("no signature found for verification")
	}

	signature := fmt.Sprintf("-----BEGIN PKCS7-----\n%s\n-----END PKCS7-----", v.Signature)
	block, rest := pem.Decode([]byte(signature))
	if len(rest) != 0 {
		return fmt.Errorf("Unable to decode signature")
	}

	sigData, err := pkcs7.Parse(block.Bytes)
	if err != nil {
		return fmt.Errorf("Unable to parse signature")
	}

	awsCert, err := awsPublicCert()
	if err != nil {
		return nil
	}

	sigData.Certificates = []*x509.Certificate{awsCert}

	if err := sigData.Verify(); err != nil {
		return fmt.Errorf("failed to verify")
	}

	if subtle.ConstantTimeCompare(v.Identity, sigData.Content) != 1 {
		return fmt.Errorf("failed to validate instance metadata")
	}

	var signedIdentityDoc identityDocument
	json.Unmarshal(sigData.Content, &signedIdentityDoc)
	elapsed := time.Since(signedIdentityDoc.PendingTime)
	if elapsed.Minutes() > BootstrapTime {
		return fmt.Errorf(
			"failed validation - this server has beens started more than %d minutes ago",
			BootstrapTime,
		)
	}

	return nil
}
702321
func (vind *NumericStaticMap) Verify(_ VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) {
	out := make([]bool, len(ids))
	for i := range ids {
		var keybytes [8]byte
		num, err := sqltypes.ToUint64(ids[i])
		if err != nil {
			return nil, vterrors.Wrap(err, "NumericStaticMap.Verify")
		}
		lookupNum, ok := vind.lookup[num]
		if ok {
			num = lookupNum
		}
		binary.BigEndian.PutUint64(keybytes[:], num)
		out[i] = bytes.Equal(keybytes[:], ksids[i])
	}
	return out, nil
}
478021
func (vind *BinaryMD5) Verify(_ VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) {
	out := make([]bool, len(ids))
	for i := range ids {
		out[i] = bytes.Equal(binHash(ids[i].ToBytes()), ksids[i])
	}
	return out, nil
}
418336
func (e *Engine) Verify(ctx context.Context, s SignatureKeyPair, b, sig []byte) (bool, error) {
	err := ctxutil.ErrIfDone(ctx)
	if err != nil {
		return false, err
	}

	return ed25519.Verify(s.Public, b, sig), nil
}
346853
func (cs Checksums) Verify(d []byte) bool {
	for _, c := range cs {
		if getU32(d, c.Offset) != c.Value {
			return false
		}
	}
	return true
}
693050
func (ref *Ref) Verify(serializedID []byte, msg []byte, sig []byte) error {
	membership, err := ref.get()
	if err != nil {
		return err
	}
	return membership.Verify(serializedID, msg, sig)
}
923657
func (u *User) Verify(msg []byte, sig []byte) error {
	return errors.New("not implemented")
}
100051
func (m *SigningMethodECDSA) Verify(raw []byte, signature Signature, key interface{}) error {

	ecdsaKey, ok := key.(*ecdsa.PublicKey)
	if !ok {
		return ErrInvalidKey
	}

	// Unmarshal asn1 ECPoint
	var ecpoint ECPoint
	if _, err := asn1.Unmarshal(signature, &ecpoint); err != nil {
		return err
	}

	// Verify the signature
	if !ecdsa.Verify(ecdsaKey, m.sum(raw), ecpoint.R, ecpoint.S) {
		return ErrECDSAVerification
	}
	return nil
}
776844
func (_m *BlockVerifier) VerifyBlockSignature(sd []*common.SignedData, config *common.ConfigEnvelope) error {
	ret := _m.Called(sd, config)

	var r0 error
	if rf, ok := ret.Get(0).(func([]*common.SignedData, *common.ConfigEnvelope) error); ok {
		r0 = rf(sd, config)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}
761310
func (p7 *PKCS7) Verify() (err error) {
	if len(p7.Signers) == 0 {
		return errors.New("pkcs7: Message has no signers")
	}
	for _, signer := range p7.Signers {
		if err := verifySignature(p7, signer); err != nil {
			return err
		}
	}
	return nil
}
823305
func (lh *LookupUnicodeLooseMD5Hash) Verify(vcursor VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) {
	if lh.writeOnly {
		out := make([]bool, len(ids))
		for i := range ids {
			out[i] = true
		}
		return out, nil
	}

	values, err := unhashList(ksids)
	if err != nil {
		return nil, fmt.Errorf("lookup.Verify.vunhash: %v", err)
	}
	ids, err = convertIds(ids)
	if err != nil {
		return nil, fmt.Errorf("lookup.Verify.vunhash: %v", err)
	}
	return lh.lkp.Verify(vcursor, ids, values)
}
124821
func (r *Request) Verify() (err error) {
	if len(r.data) == 0 {
		return NewError(ErrInvalidValue, "Update does not contain data")
	}
	if r.Signature == nil {
		return NewError(ErrInvalidSignature, "Missing signature field")
	}

	digest, err := r.GetDigest()
	if err != nil {
		return err
	}

	// get the address of the signer (which also checks that it's a valid signature)
	r.Feed.User, err = getUserAddr(digest, *r.Signature)
	if err != nil {
		return err
	}

	// check that the lookup information contained in the chunk matches the updateAddr (chunk search key)
	// that was used to retrieve this chunk
	// if this validation fails, someone forged a chunk.
	if !bytes.Equal(r.idAddr, r.Addr()) {
		return NewError(ErrInvalidSignature, "Signature address does not match with update user address")
	}

	return nil
}