Poor design impacts Java AES-GCM encryption performance
- Dominant language
- Java
- Stars
- 1.4k
- Forks
- 326
- Avg merge
- 16h 22m
- Merged PRs (30d)
- 17
Description
AEAD ciphers like AES-GCM and AES-CCM must embargo plaintext during *decryption* until the tag is verified. This is understood. However conscrypt also embargoes *ciphertext* during *encryption* for AES-GCM. This is unnecessary and undesirable.
It appears that the reason this is happening is because both GCM and CCM modes are lumped together and use [this class](https://github.com/google/conscrypt/blob/master/common/src/main/java/org/conscrypt/OpenSSLAeadCipher.java). CCM differs from GCM in that the length of the plaintext is a parameter to the scheme, so embargoing the ciphertext until `doFinal` makes some sense for CCM because the length is known for the first time. But this is completely unnecessary for GCM mode. Please create a separate class just for GCM mode and let CCM mode and it's limitations live alone in ignominy.
Contributor guide
Assessment
This issue has not been assessed yet.