diff --git a/packages/native_crypto/lib/src/ciphers/aes/aes.dart b/packages/native_crypto/lib/src/ciphers/aes/aes.dart index 8eda12e..9d995fe 100644 --- a/packages/native_crypto/lib/src/ciphers/aes/aes.dart +++ b/packages/native_crypto/lib/src/ciphers/aes/aes.dart @@ -288,13 +288,6 @@ class AES implements Cipher { ); } - if (bytes.isEmpty) { - throw NativeCryptoException( - code: NativeCryptoExceptionCode.invalidData, - message: 'Platform returned no data on chunk #$count', - ); - } - return bytes; } } diff --git a/packages/native_crypto/lib/src/core/constants/constants.dart b/packages/native_crypto/lib/src/core/constants/constants.dart index c9b13ae..97b111c 100644 --- a/packages/native_crypto/lib/src/core/constants/constants.dart +++ b/packages/native_crypto/lib/src/core/constants/constants.dart @@ -6,8 +6,13 @@ abstract class Constants { /// The default chunk size in bytes used for encryption and decryption. + /// + /// ~32MB static const int defaultChunkSize = 33554432; + /// The length of the initialization vector in bytes used for AES GCM. static const int aesGcmNonceLength = 12; + + /// The length of the tag in bytes used for AES GCM. static const int aesGcmTagLength = 16; }