aead: Add AES-EAX key manager support#852
Open
mikedanese wants to merge 1 commit intoproject-oak:mainfrom
Open
aead: Add AES-EAX key manager support#852mikedanese wants to merge 1 commit intoproject-oak:mainfrom
mikedanese wants to merge 1 commit intoproject-oak:mainfrom
Conversation
Collaborator
daviddrysdale
left a comment
There was a problem hiding this comment.
Thanks for this, looks good
| aes-gcm-siv = "^0.11.1" | ||
| chacha20poly1305 = "^0.10" | ||
| ctr = "^0.9.2" | ||
| eax = "^0.5.0" |
Collaborator
There was a problem hiding this comment.
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?
Author
There was a problem hiding this comment.
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
e282e9d to
b28759a
Compare
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.
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:
For testing, I tried to match the same coverage that AES-GCM key manager has.
Test coverage: