stream static method
Generates a stream of pseudo-random bytes using the ChaCha stream cipher.
This function generates a stream of pseudo-random bytes by encrypting a nonce and key with the
ChaCha stream cipher algorithm. The generated stream is then XORed with the dst data, resulting
in the encrypted output. It also provides the option to incorporate a nonce inplace counter.
Parameters:
key: The encryption key as aList<int>.nonce: A unique nonce as aList<int>.dst: The destinationList<int>where the generated stream will be XORed.nonceInplaceCounterLength: An optional parameter to specify the length of the nonce inplace counter (default is 0, meaning no nonce inplace counter).
Implementation
static List<int> stream(
List<int> key,
List<int> nonce,
List<int> dst, {
int nonceInplaceCounterLength = 0,
}) {
BinaryOps.zero(dst);
return streamXOR(
key,
nonce,
dst,
dst,
nonceInplaceCounterLength: nonceInplaceCounterLength,
);
}