chaCha20Poly1305Encrypt static method

List<int> chaCha20Poly1305Encrypt({
  1. required List<int> key,
  2. required List<int> nonce,
  3. required List<int> plainText,
  4. List<int>? assocData,
})

Encrypt data using the ChaCha20-Poly1305 authenticated encryption algorithm. Requires a key, nonce, plaintext, and optional associated data.

Implementation

static List<int> chaCha20Poly1305Encrypt({
  required List<int> key,
  required List<int> nonce,
  required List<int> plainText,
  List<int>? assocData,
}) {
  final chacha = ChaCha20Poly1305(key);
  return chacha.encrypt(nonce, plainText, associatedData: assocData);
}