ParagonIE_Sodium_Compat::crypto_auth_verify() public WP 1.0
Verify the MAC of a message previously authenticated with crypto_auth.
{} Это метод класса: ParagonIE_Sodium_Compat{}
Хуков нет.
Возвращает
true/false. TRUE if authenticated, FALSE otherwise
Использование
$result = ParagonIE_Sodium_Compat::crypto_auth_verify( $mac, $message, $key );
- $mac(строка) (обязательный)
- Message authentication code
- $message(строка) (обязательный)
- Message whose authenticity you are attempting to verify (with a given MAC and key)
- $key(строка) (обязательный)
- Symmetric authentication key
Код ParagonIE_Sodium_Compat::crypto_auth_verify() ParagonIE Sodium Compat::crypto auth verify WP 5.6.2
public static function crypto_auth_verify($mac, $message, $key)
{
/* Type checks: */
ParagonIE_Sodium_Core_Util::declareScalarType($mac, 'string', 1);
ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 2);
ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3);
/* Input validation: */
if (ParagonIE_Sodium_Core_Util::strlen($mac) !== self::CRYPTO_AUTH_BYTES) {
throw new SodiumException('Argument 1 must be CRYPTO_AUTH_BYTES long.');
}
if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AUTH_KEYBYTES) {
throw new SodiumException('Argument 3 must be CRYPTO_AUTH_KEYBYTES long.');
}
if (self::useNewSodiumAPI()) {
return (bool) sodium_crypto_auth_verify($mac, $message, $key);
}
if (self::use_fallback('crypto_auth_verify')) {
return (bool) call_user_func('\\Sodium\\crypto_auth_verify', $mac, $message, $key);
}
if (PHP_INT_SIZE === 4) {
return ParagonIE_Sodium_Crypto32::auth_verify($mac, $message, $key);
}
return ParagonIE_Sodium_Crypto::auth_verify($mac, $message, $key);
}