You are here

public static function ParagonIE_Sodium_Core32_ChaCha20::stream in Automatic Updates 8

Same name and namespace in other branches
  1. 7 vendor/paragonie/sodium_compat/src/Core32/ChaCha20.php \ParagonIE_Sodium_Core32_ChaCha20::stream()

@internal You should not use this directly from another application

Parameters

int $len:

string $nonce:

string $key:

Return value

string

Throws

SodiumException

TypeError

3 calls to ParagonIE_Sodium_Core32_ChaCha20::stream()
ParagonIE_Sodium_Crypto32::aead_chacha20poly1305_decrypt in vendor/paragonie/sodium_compat/src/Crypto32.php
AEAD Decryption with ChaCha20-Poly1305
ParagonIE_Sodium_Crypto32::aead_chacha20poly1305_encrypt in vendor/paragonie/sodium_compat/src/Crypto32.php
AEAD Encryption with ChaCha20-Poly1305
ParagonIE_Sodium_Crypto32::secretbox_xchacha20poly1305_open in vendor/paragonie/sodium_compat/src/Crypto32.php
Decrypt a ciphertext generated via secretbox_xchacha20poly1305().
1 method overrides ParagonIE_Sodium_Core32_ChaCha20::stream()
ParagonIE_Sodium_Core32_XChaCha20::stream in vendor/paragonie/sodium_compat/src/Core32/XChaCha20.php
@internal You should not use this directly from another application

File

vendor/paragonie/sodium_compat/src/Core32/ChaCha20.php, line 337

Class

ParagonIE_Sodium_Core32_ChaCha20
Class ParagonIE_Sodium_Core32_ChaCha20

Code

public static function stream($len = 64, $nonce = '', $key = '') {
  return self::encryptBytes(new ParagonIE_Sodium_Core32_ChaCha20_Ctx($key, $nonce), str_repeat("\0", $len));
}