ParagonIE_Sodium_Core32_Poly1305::onetimeauth_verify() public WP 1.0
{} It's a method of the class: ParagonIE_Sodium_Core32_Poly1305{}
No Hooks.
Return
true|false
. Null. Nothing.
Usage
$result = ParagonIE_Sodium_Core32_Poly1305::onetimeauth_verify( $mac, $m, $key );
- $mac(string) (required)
- -
- $m(string) (required)
- -
- $key(string) (required)
- -
Code of ParagonIE_Sodium_Core32_Poly1305::onetimeauth_verify() ParagonIE Sodium Core32 Poly1305::onetimeauth verify WP 5.7
public static function onetimeauth_verify($mac, $m, $key)
{
if (self::strlen($key) < 32) {
throw new InvalidArgumentException(
'Key must be 32 bytes long.'
);
}
$state = new ParagonIE_Sodium_Core32_Poly1305_State(
self::substr($key, 0, 32)
);
$calc = $state
->update($m)
->finish();
return self::verify_16($calc, $mac);
}