fix(api): accept empty decrypted plaintext
This commit is contained in:
parent
5be6296829
commit
2f22cc549d
@ -288,13 +288,6 @@ class AES implements Cipher<AESCipherChunk> {
|
||||
);
|
||||
}
|
||||
|
||||
if (bytes.isEmpty) {
|
||||
throw NativeCryptoException(
|
||||
code: NativeCryptoExceptionCode.invalidData,
|
||||
message: 'Platform returned no data on chunk #$count',
|
||||
);
|
||||
}
|
||||
|
||||
return bytes;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user