ChaCha20Poly1305 constructor

ChaCha20Poly1305(
  1. List<int> key
)

Creates a ChaCha20-Poly1305 instance with the given 32-byte encryption key.

Implementation

ChaCha20Poly1305(List<int> key) {
  if (key.length != _keyLength) {
    throw const ArgumentException("ChaCha20Poly1305 needs a 32-byte key");
  }
  _key = BytesUtils.toBytes(key);
}