Skip to content

aead: Add AES-EAX key manager support#852

Open
mikedanese wants to merge 1 commit intoproject-oak:mainfrom
mikedanese:mikedanese/jj/knstyrlnpvys
Open

aead: Add AES-EAX key manager support#852
mikedanese wants to merge 1 commit intoproject-oak:mainfrom
mikedanese:mikedanese/jj/knstyrlnpvys

Conversation

@mikedanese
Copy link
Copy Markdown

Implement complete AES-EAX AEAD support in the aead crate, following the patterns established by tink-cc and existing tink-rust AEAD implementations. Due to limitations in the Rust eax crate, this implementation only supports 16-byte (128-bit) IVs. tink-cc supports both 12-byte and 16-byte nonce but 16-byte is the default.

Key changes:

  • Add eax crate from RustCrypto as dependency
  • Implement AesEax subtle primitive with AES-128 and AES-256 support
  • Implement AesEaxKeyManager with key validation and generation
  • Add key templates for AES-128-EAX and AES-256-EAX
  • Register key manager and templates in library init
  • Add comprehensive test coverage including wycheproof vectors

For testing, I tried to match the same coverage that AES-GCM key manager has.

Test coverage:

  • Basic encrypt/decrypt with various key and message sizes
  • Tag length and IV size validation
  • Long message tests and ciphertext modification tests
  • 26 wycheproof test vectors (filtered from 171 for supported params)
  • Key manager validation and primitive instantiation tests

Copy link
Copy Markdown
Collaborator

@daviddrysdale daviddrysdale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, looks good

aes-gcm-siv = "^0.11.1"
chacha20poly1305 = "^0.10"
ctr = "^0.9.2"
eax = "^0.5.0"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should put the new code behind an eax feature so any existing users aren't forced to have the new dependency. OTOH, the existing code already has multiple variants without any features, so maybe not.

@conradgrobler : thoughts/preferences?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, let me know. I would also like to follow up with support for xaes-gcm.

Implement complete AES-EAX AEAD support in the aead crate, following the
patterns established by tink-cc and existing tink-rust AEAD
implementations. Due to limitations in the Rust eax crate, this
implementation only supports 16-byte (128-bit) IVs. tink-cc supports
both 12-byte and 16-byte nonce but 16-byte is the default.

Key changes:
- Add eax crate from RustCrypto as dependency
- Implement AesEax subtle primitive with AES-128 and AES-256 support
- Implement AesEaxKeyManager with key validation and generation
- Add key templates for AES-128-EAX and AES-256-EAX
- Register key manager and templates in library init
- Add comprehensive test coverage including wycheproof vectors

For testing, I tried to match the same coverage that AES-GCM key manager
has.

Test coverage:
- Basic encrypt/decrypt with various key and message sizes
- Tag length and IV size validation
- Long message tests and ciphertext modification tests
- 26 wycheproof test vectors (filtered from 171 for supported params)
- Key manager validation and primitive instantiation tests
@mikedanese mikedanese force-pushed the mikedanese/jj/knstyrlnpvys branch from e282e9d to b28759a Compare March 31, 2026 18:34
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.

2 participants