Skip to content

Add AES-128 and AES-128-GCM - #51

Merged
david415 merged 1 commit into
mainfrom
aes128-gcm
Oct 26, 2026
Merged

david415 merged 1 commit into
mainfrom
aes128-gcm

Conversation

@david415

Copy link
Copy Markdown
Member

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); encryptBlock reads the round count off the schedule's length, so AES-256 callers (GCM-SIV, CTR, AEZ) are unchanged. Adds expandKey128 and encryptBlockWithKey128.
  • AESGCM: the construction now runs over an expanded key schedule, so size_encrypt, decrypt_encrypt and decrypt_sound are proved once and both Scheme (AES-256-GCM) and the new Scheme128 (AES-128-GCM) are built from them. The schedule is expanded once in keyFromBytes rather than on every call.
  • Vectors: FIPS-197 C.1 block; Wycheproof aes_gcm_test.json 128-bit groups (67 vectors) extracted with the existing scripts/extract_wycheproof_aead.py. The same upstream file regenerates testdata/aes256_gcm.json byte for byte.

Tested:

  • lake build (whole library)
  • Cipher.test: FIPS-197 C.1 and C.3, POLYVAL, GCM-SIV
  • aead_vectors_test: ChaCha20-Poly1305 316/316, AES-256-GCM 66/66, AES-128-GCM 67/67
  • WideBlockCipher.test, BACAP.test, Sphinx.crypto_test (AES-256 users)
  • scripts/check-axioms.sh on AESGCM.lean

AES here is still table-based and not constant time; a constant-time AES follows in a separate PR.

@david415
david415 merged commit 52b9fb4 into main Oct 26, 2026
3 checks passed
@david415
david415 deleted the aes128-gcm branch October 26, 2026 00:07
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

Successfully merging this pull request may close these issues.

1 participant