google / google/conscrypt

Poor design impacts Java AES-GCM encryption performance

Open
#697 2 comments 2 reactions 0 assignees View on GitHub
needs investigation
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.