-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handles variable-length nonce #125
Conversation
type TagSize = U16; | ||
type CiphertextOverhead = U0; | ||
|
||
fn encrypt_in_place_detached( | ||
&self, | ||
nonce: &GenericArray<u8, Self::NonceSize>, | ||
nonce: &[u8], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would require a change in the Aead
trait. See RustCrypto/traits#65
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I did that too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aah, apologies!
@masihyeganeh so there's another option which preserves type safety for all nonce sizes and avoids making changes to the underlying trait... that would be making the AES implementation generic around different nonce sizes much in the same way it's already generic around I think that's probably the best way to go in general, actually. If you'd like I can adapt your PR to do do that, as |
@tarcieri That would be great. let me know if I can help with that |
I've open a PR based on this one which makes |
I'm trying to fix #62, but I'm not sure I'm on the right track.
I read source code of other implementations of variable-length nonce GCM. They do it like this:
I did that here. Maybe it's wrong. I'm not sure.
This will be a breaking change but as mentioned in here, it is time to introduce breaking changes.