Defuse\Crypto\Crypto::verifyHMAC PHP Method

verifyHMAC() protected static method

Verifies an HMAC without leaking information through side-channels.
protected static verifyHMAC ( string $correct_hmac, string $message, string $key ) : boolean
$correct_hmac string
$message string
$key string
return boolean
    protected static function verifyHMAC($correct_hmac, $message, $key)
    {
        $message_hmac = \hash_hmac(Core::HASH_FUNCTION_NAME, $message, $key, true);
        return Core::hashEquals($correct_hmac, $message_hmac);
    }