encrypt method
Cifra plaintext e retorna um EncryptedPayload com ciphertext e tag GCM.
Implementation
EncryptedPayload encrypt(List<int> plaintext) {
_validate();
final ek = aesExpandKey(key);
final h = aesEncryptBlock(Uint8List(16), ek); // H = AES_K(0^128)
final j0 = _makeJ0();
final ct = _gctr(ek, _inc32(j0), plaintext);
final tag = _computeTag(ek, h, j0, ct);
return EncryptedPayload(
algorithm: CryptAlgorithm.aesGcm,
ciphertext: Uint8List.fromList(ct),
key: key,
tag: tag,
nonce: nonce,
aad: aad,
);
}