ParagonIE_Sodium_File::onetimeauth_verify() protected WP 1.0
{} It's a method of the class: ParagonIE_Sodium_File{}
No Hooks.
Return
true|false
. Null. Nothing.
Usage
$result = ParagonIE_Sodium_File::onetimeauth_verify(;
Code of ParagonIE_Sodium_File::onetimeauth_verify() ParagonIE Sodium File::onetimeauth verify WP 5.7
protected static function onetimeauth_verify(
ParagonIE_Sodium_Core_Poly1305_State $state,
$ifp,
$tag = '',
$mlen = 0
) {
/** @var int $pos */
$pos = self::ftell($ifp);
/** @var int $iter */
$iter = 1;
/** @var int $incr */
$incr = self::BUFFER_SIZE >> 6;
while ($mlen > 0) {
$blockSize = $mlen > self::BUFFER_SIZE
? self::BUFFER_SIZE
: $mlen;
$ciphertext = fread($ifp, $blockSize);
if (!is_string($ciphertext)) {
throw new SodiumException('Could not read input file');
}
$state->update($ciphertext);
$mlen -= $blockSize;
$iter += $incr;
}
$res = ParagonIE_Sodium_Core_Util::verify_16($tag, $state->finish());
fseek($ifp, $pos, SEEK_SET);
return $res;
}