Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12 byte MAC throwing ArgumentError exception when using AES-GCM #229

Open
jingramwright opened this issue Apr 12, 2024 · 0 comments
Open

Comments

@jingramwright
Copy link

I'm currently rewriting an existing Kotlin encryption/decryption implementation in Dart for a project uplift and I'm running into an issue with the following code:

final aesGcmCipher = GCMBlockCipher(AESEngine())..init(false, AEADParameters(KeyParameter(kmAndIv.km), (tagSize * bitsInAByte), kmAndIv.iv, Uint8List.fromList([])));

Where tagSize is 12, throws the exception:

ArgumentError (Invalid argument(s): macSize should be equal to 16 for GCM)

I've found this article, and I'm assuming this library also only supports 16-byte MAC's due to Apple's CryptoKit on macOS.

Is this the case? If so, is there anyway the MAC size can be enforced only on macOS?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant