Repository navigation
Add AES-128 and AES-128-GCM - #51
Merged
Merged
Conversation
This was referenced Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
QUIC (RFC 9001) fixes Initial packet protection to AES-128-GCM with AES-128-ECB header protection, so lean_tls/lean_quic need AES-128 whatever suite the handshake negotiates.
AES: the key schedule takes the key length (FIPS-197 §5.2, Nk = 4 or 8);encryptBlockreads the round count off the schedule's length, so AES-256 callers (GCM-SIV, CTR, AEZ) are unchanged. AddsexpandKey128andencryptBlockWithKey128.AESGCM: the construction now runs over an expanded key schedule, sosize_encrypt,decrypt_encryptanddecrypt_soundare proved once and bothScheme(AES-256-GCM) and the newScheme128(AES-128-GCM) are built from them. The schedule is expanded once inkeyFromBytesrather than on every call.aes_gcm_test.json128-bit groups (67 vectors) extracted with the existingscripts/extract_wycheproof_aead.py. The same upstream file regeneratestestdata/aes256_gcm.jsonbyte for byte.Tested:
lake build(whole library)Cipher.test: FIPS-197 C.1 and C.3, POLYVAL, GCM-SIVaead_vectors_test: ChaCha20-Poly1305 316/316, AES-256-GCM 66/66, AES-128-GCM 67/67WideBlockCipher.test,BACAP.test,Sphinx.crypto_test(AES-256 users)scripts/check-axioms.shonAESGCM.leanAES here is still table-based and not constant time; a constant-time AES follows in a separate PR.