$block0 =
str_repeat("\x00", 32
);
/** @var int $mlen - Length of the plaintext message */
$mlen = ParagonIE_Sodium_Core32_Util::
strlen($plaintext);
$mlen0 =
$mlen;
if ($mlen0 > 64 - self::secretbox_xsalsa20poly1305_ZEROBYTES
) { $mlen0 = 64 - self::secretbox_xsalsa20poly1305_ZEROBYTES;
} $block0 .= ParagonIE_Sodium_Core32_Util::
substr($plaintext, 0,
$mlen0);
/** @var string $block0 */
$block0 = ParagonIE_Sodium_Core32_Salsa20::
salsa20_xor( $block0,
ParagonIE_Sodium_Core32_Util::
substr($nonce, 16, 8
),
$subkey );
/** @var string $c */
$c = ParagonIE_Sodium_Core32_Util::
substr( $block0,
self::secretbox_xsalsa20poly1305_ZEROBYTES
);
if ($mlen >
$mlen0) {