seal method

Future<List<int>> seal(
  1. List<int> plaintext
)

Encrypts plaintext with the next sending message key. The returned bytes are counter(4) ‖ ciphertext.

Implementation

Future<List<int>> seal(List<int> plaintext) async {
  final (counter, messageKey) = _send.next();
  final sealed = await _cipherFor(messageKey).encrypt(plaintext);
  _wipe(messageKey);
  return [..._u32(counter), ...sealed];
}