Skip to content

aead: Add AES-EAX key manager support#852

Merged
daviddrysdale merged 1 commit intoproject-oak:mainfrom
mikedanese:mikedanese/jj/knstyrlnpvys
Apr 28, 2026
Merged

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

Conversation

@mikedanese
Copy link
Copy Markdown
Contributor

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
Contributor

@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

Comment thread aead/src/subtle/aes_eax.rs Outdated
Comment thread tests/tests/aead/aes_eax_key_manager_test.rs Outdated
Comment thread aead/src/subtle/aes_eax.rs Outdated
Comment thread aead/src/subtle/aes_eax.rs Outdated
Comment thread aead/Cargo.toml
@mikedanese mikedanese force-pushed the mikedanese/jj/knstyrlnpvys branch from e282e9d to b28759a Compare March 31, 2026 18:34
Copy link
Copy Markdown
Contributor

@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.

There's a couple of trivial warnings from cargo +nightly fmt --all -- --check, and this will need to be rebased after #864 goes in.

@mikedanese mikedanese force-pushed the mikedanese/jj/knstyrlnpvys branch from b28759a to 6a60a03 Compare April 24, 2026 16:51
@mikedanese
Copy link
Copy Markdown
Contributor Author

Fixed. Thanks!

@daviddrysdale
Copy link
Copy Markdown
Contributor

Looks like there's still a couple of trivial line-reflow warnings from cargo check?

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 6a60a03 to 27d8f64 Compare April 27, 2026 17:03
@mikedanese
Copy link
Copy Markdown
Contributor Author

Ok, fixed that failure from the failed action. Let's see if that does it.

@daviddrysdale daviddrysdale merged commit eecf54c into project-oak:main Apr 28, 2026
22 checks passed
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.

3 participants