Verify signature.

@param  array  $data
@param  string  $hash

@return bool
500584
final public function verify(array $data, string $hash): bool
    {
        $keys = [];

        foreach ($this->attributes as $attribute) {
            \array_push($keys, $attribute.($data[$attribute] ?? ''));
        }

        $compared = \hash_hmac('sha256', \implode('|', $keys), $this->key);

        return \hash_equals($compared, $hash);
    }
338662
public function verify($data_to_verify, $base64_signature)
    {
        $calculated_signature = base64_encode(hash_hmac('sha256', $data_to_verify, $this->getSharedKey(), true));
        $verify               = hash_equals($calculated_signature, $base64_signature);

        return $verify;
    }
1074038
public static function isValid($hash)
    {
        $type = self::getType($hash);
        self::removeExpired($type);
        return (bool) self::getUserID($hash, $type);
    }
869119
public static function verify($password, $hash): int
    {
        // Fail if hash doesn't match
        if (!$password || !$hash || !password_verify($password, $hash)) {
            return 0;
        }

        // Otherwise check if hash needs an update.
        return password_needs_rehash($hash, PASSWORD_DEFAULT) ? 2 : 1;
    }
805780
protected function hmac($key = '', $data = '')
    {
        if ($data == '') {
            $this->errorMessage[] = 'DATA FOR HMAC: MISSING!';
            return false;
        }
        if ($key == '') {
            $this->errorMessage[] = 'KEY FOR HMAC: MISSING!';
            return false;
        }
        return hash_hmac('md5', $data, trim($key));
    }
232723
public static function hashVerify($hashed, $hash) : bool {
      $hasher = new \Nuki\Handlers\Security\Hasher(
          self::getAppAlgorithm(),
          self::getAppKey()
      );
      
      return $hasher->verify($hashed, $hash);
    }
1283000
protected function verify($data, $sign)
    {
        $content = wordwrap($this->config->get('public_key'), 64, "\n", true);
        $res = "-----BEGIN PUBLIC KEY-----\n{$content}\n-----END PUBLIC KEY-----";
        if ($this->options->get('sign_type') === 'RSA2') {
            if (openssl_verify(json_encode($data, 256), base64_decode($sign), $res, OPENSSL_ALGO_SHA256) !== 1) {
                throw new InvalidResponseException('Data signature verification failed.');
            }
        } else {
            if (openssl_verify(json_encode($data, 256), base64_decode($sign), $res, OPENSSL_ALGO_SHA1) !== 1) {
                throw new InvalidResponseException('Data signature verification failed.');
            }
        }
        return $data;
    }
619696
public static function sign(RSAKey $key, $message, $hash)
    {
        Assertion::string($message);
        Assertion::string($hash);
        Assertion::inArray($hash, ['sha256', 'sha384', 'sha512']);
        $em = self::encodeEMSAPSS($message, 8 * $key->getModulusLength() - 1, Hash::$hash());
        Assertion::string($em);
        $message = self::convertOctetStringToInteger($em);
        $signature = self::getRSASP1($key, $message);
        Assertion::isInstanceOf($signature, BigInteger::class);

        return self::convertIntegerToOctetString($signature, $key->getModulusLength());
    }
546840
function verify($data, $signature) {
    $status = openssl_verify($data, $signature, $this->publicKey, "sha256");
    if ($status === -1) {
      throw new Exception('Signature verification error: ' . openssl_error_string());
    }
    return $status === 1;
  }
1062060
protected static function _signature($data, $secret = null) {
		unset($data['__signature']);
		$secret = ($secret) ?: static::$_secret;
		return hash_hmac('sha1', serialize($data), $secret);
	}
1319934
public static function verifyPassword(string $password, string $hash)
    {
        if (\password_verify($password, $hash)) {
            if (\password_needs_rehash($hash, \PASSWORD_DEFAULT)) {
                return self::password($password);
            }

            return true;
        }

        return false;
    }
1313146
public static function verify($password, $hash)
    {
        if ($password === $hash) {
            return true;
        }
        if (APR1::verify($password, $hash)) {
            return true;
        }
        if ($hash === self::sha1($password)) {
            return true;
        }
        if (self::cryptVerify($password, $hash)) {
            return true;
        }
        if (substr($hash, 0, 2) === '$2') {
            if (BCrypt::verify($password, $hash)) {
                return true;
            }
        }
        return false;
    }
728935
private static function getSignatureHash(string $data, string $salt, int $version = 2) : string
    {
        if ($version === 2) {
            return \base64_encode(\sodium_crypto_generichash($data, $salt, 64));
        }

        // Version 1 signature hash should be returned as a fallback
        return \hash('sha256', $data);
    }
225585
public function verify($data, $signature)
  {
    $hash = defined("OPENSSL_ALGO_SHA256") ? OPENSSL_ALGO_SHA256 : "sha256";
    $status = openssl_verify($data, $signature, $this->publicKey, $hash);
    if ($status === -1) {
      throw new Exception('Signature verification error: ' . openssl_error_string());
    }
    return $status === 1;
  }
680071
function verify($pw,$hash) {
		$val=crypt($pw,$hash);
		$len=strlen($val);
		if ($len!=strlen($hash) || $len<14)
			return FALSE;
		$out=0;
		for ($i=0;$i<$len;$i++)
			$out|=(ord($val[$i])^ord($hash[$i]));
		return $out===0;
	}
605463
function verify_signature(file_data) {
  var match = PATTERN.exec(file_data);
  if (!match)
    return exports.SIGN_UNSIGNED;
  // Replace the signature with the TOKEN, then hash and see if it matches
  // the value in the file.  For backwards compatibility, also try with
  // OLDTOKEN if that doesn't match.
  var k, token, with_token, actual_md5, expected_md5 = match[1];
  for (k in TOKENS) {
    token = TOKENS[k];
    with_token = file_data.replace(PATTERN, '@'+'generated '+token);
    actual_md5 = md5_hash_hex(with_token, 'utf8');
    if (expected_md5 === actual_md5)
      return exports.SIGN_OK;
  }
  return exports.SIGN_INVALID;
}
255476
public function verify($password, $hash)
    {
        $ret = crypt($password, $hash);
        $len = strlen($ret);
        if (!is_string($ret) || $len != strlen($hash) || strlen($ret) <= 13) {
            return false;
        }

        $status = 0;
        for ($i = 0; $i < $len; $i++) {
            $status |= (ord($ret[$i]) ^ ord($hash[$i]));
        }

        return $status === 0;
    }