xchacha20 function
Apply XChaCha20 cipher with the follwing parameters:
Parameters:
message
: arbitrary length plain-text.key
: 32 bytes key.nonce
: 24 bytes nonce. (Default: random)counter
: 64-bit counter. (Default: 1)
Both the encryption and decryption can be done using this same method.
Implementation
@pragma('vm:prefer-inline')
Uint8List xchacha20(
List<int> message,
List<int> key, {
List<int>? nonce,
Nonce64? counter,
}) =>
XChaCha20(key, nonce, counter).convert(message);