Skip to content

Conversation

@masihyeganeh
Copy link

I'm trying to fix #65, but I'm not sure I'm on the right track.
This PR changes nonce type to &[u8] instead of fixed-sized GenericArray.
The main code to handle variable-length nonces will be in RustCrypto/AEADs.

@tarcieri
Copy link
Member

tarcieri commented Mar 11, 2020

I like the idea of it being possible to use a slice for a nonce (this is a blocker AES-SIV too), but I don't like it being unilateral, because it introduces potential errors when using AEADs with a fixed-size nonce (which is the case 99.9% of the time).

I think it might make sense to make the nonce an associated type. See the sketch of that idea I suggested on the original Aead trait PR:

#40 (comment)

@masihyeganeh
Copy link
Author

I like your solution better. I just not exactly sure how to do it.
This variable-length nonce feature is holding my project back. I am willing to help implementing it.
Just let me know if I can help you with this.

@tarcieri
Copy link
Member

It seems RustCrypto/AEADs#126 takes care of supporting any-sized GCM none without changing the trait.

This also seems like a general solution to the problem (i.e. making Aead::NonceSize generic) so I think that's actually more desirable than trying to support slices as nonces.

@tarcieri tarcieri closed this Mar 14, 2020
dns2utf8 pushed a commit to dns2utf8/traits that referenced this pull request Jan 24, 2023
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.

aead: support variable-length nonces

2 participants