-
Notifications
You must be signed in to change notification settings - Fork 161
ocb3: migrate internals to use inout #667
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
base: master
Are you sure you want to change the base?
Conversation
I couldn't figure out a way to test inout here with two separate buffers, but this gets tested in #665 when it's plugged with |
1d3e113
to
3eddf5a
Compare
ocb3/src/lib.rs
Outdated
pub(crate) type Block = Array<u8, U16>; | ||
type BlockSize = U16; | ||
pub(crate) type Block = Array<u8, BlockSize>; | ||
type DoubleBlock = Array<u8, <BlockSize as Mul<U2>>::Output>; |
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.
Alternatively you can use Add
instead of Mul<U2>
(where Add
implicitly takes Self
as a default) e.g. https://github.com/RustCrypto/AEADs/blob/a09f3d2/aes-siv/src/siv.rs#L101
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.
It's an internal type, I think it's better to be explicit about the intent?
Relying on the implicit value of Add makes it harder to read imho.
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.
went with typenum::Prod
0aeac3f
to
42e4e95
Compare
e5ff157
to
54a2f61
Compare
This is to prepare the migration to
AeadInOut
, following RustCrypto/traits#1793Depends: