From 324b035cadbb828e9ac51a9bc21d37da3b468c34 Mon Sep 17 00:00:00 2001 From: Nguyen Van Nguyen Date: Mon, 18 Nov 2024 12:34:41 +0700 Subject: [PATCH] WIP Signed-off-by: Nguyen Van Nguyen --- lib/src/packet/aead_encrypted_data.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/packet/aead_encrypted_data.dart b/lib/src/packet/aead_encrypted_data.dart index 783e700a..d3f0658a 100644 --- a/lib/src/packet/aead_encrypted_data.dart +++ b/lib/src/packet/aead_encrypted_data.dart @@ -189,7 +189,7 @@ class AeadEncryptedData extends ContainedPacket { ); final processed = dataLength - tagLength * (dataLength / chunkSize).ceil(); - final crypted = Uint8List(processed); + final crypted = Uint8List(processed + (forEncryption ? aead.tagLength : 0)); for (var chunkIndex = 0; chunkIndex == 0 || data.isNotEmpty;) { final chunkIndexData = adataBuffer.sublist(5, 13); final size = chunkSize < data.length ? chunkSize : data.length;