ParagonIE_Sodium_File::onetimeauth_verify_core32() – One-time message authentication for 32-bit systems

You appear to be a bot. Output may be restricted

Description

One-time message authentication for 32-bit systems

Usage

$bool = ParagonIE_Sodium_File::onetimeauth_verify_core32( $state, $ifp, $tag, $mlen );

Parameters

$state
( ParagonIE_Sodium_Core32_Poly1305_State ) required
$ifp
( resource ) required
$tag
( string ) optional
$mlen
( int ) optional

Returns

bool

Source

File name: wordpress/wp-includes/sodium_compat/src/File.php
Lines:

1 to 25 of 25
    protected static function onetimeauth_verify_core32(
        ParagonIE_Sodium_Core32_Poly1305_State $state,
        $ifp,
        $tag = '',
        $mlen = 0
    ) {
        
/** @var int $pos */
        $pos = self::ftell($ifp);

        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;
        }
        $res = ParagonIE_Sodium_Core32_Util::verify_16($tag, $state->finish());

        fseek($ifp, $pos, SEEK_SET);
        return $res;
    }
 

 View on GitHub View on Trac