ParagonIE_Sodium_Core_XChaCha20::stream() public WP 1.0
{} It's a method of the class: ParagonIE_Sodium_Core_XChaCha20{}
No Hooks.
Return
String
. Null. Nothing.
Usage
$result = ParagonIE_Sodium_Core_XChaCha20::stream( $len, $nonce, $key );
- $len(int)
- -
- $nonce(string)
- -
- $key(string)
- -
Code of ParagonIE_Sodium_Core_XChaCha20::stream() ParagonIE Sodium Core XChaCha20::stream WP 5.7
public static function stream($len = 64, $nonce = '', $key = '')
{
if (self::strlen($nonce) !== 24) {
throw new SodiumException('Nonce must be 24 bytes long');
}
return self::encryptBytes(
new ParagonIE_Sodium_Core_ChaCha20_Ctx(
self::hChaCha20(
self::substr($nonce, 0, 16),
$key
),
self::substr($nonce, 16, 8)
),
str_repeat("\x00", $len)
);
}