-
Notifications
You must be signed in to change notification settings - Fork 26
[AES-GCM] Cleanup to prepare crate for release #1185
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: main
Are you sure you want to change the base?
Conversation
03b27a5
to
f8c6bb9
Compare
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.
Looks like there's an AesGcm128
(and 256) in the top level as well as in the aes_gcm_128
module. That's a little odd? Looks like we have multiple APIs exposed here for the same thing.
5e07eb8
to
4cd7a74
Compare
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.
I think this looks pretty good!
Just one check should be added from the initial discussion.
Review re-requested
This reverts commit ba7a3a8.
aad: &[u8], | ||
plaintext: &[u8], | ||
) -> Result<(), EncryptError> { | ||
if plaintext.len() / crate::aes::AES_BLOCK_LEN >= (u32::MAX - 1) as usize { |
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.
There's lots of code duplication here. That's not great. We should move all checks into the common functions instead.
These implementations shouldn't do much more than passing things along to the actual functions, picking the right one, and converting arguments where necessary.
pub(crate) use aesgcm; | ||
|
||
/// Helper module for implementing platform-specific modules | ||
macro_rules! platform_mod { |
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.
Do we really need all these types? The types aren't different for different platforms.
Rebased onto
main
fromaes-gcm
:[AES-GCM] Cleanup to prepare the new
libcrux-aesgcm
crate for releaseKey
,Nonce
,Tag
type aliases can be found in a module that corresponds to each implementationlibcrux_aesgcm
->libcrux-aesgcm
(for consistency with other crates in this repository)libcrux_traits
-based public APIs (the ones defined intyped_owned
andtyped_refs
)libcrux_traits
API implementation into separate modulelibcrux_aesgcm::aes_gcm_128::neon::{Key, Nonce, Tag}
One other point that was part of release prep/cleanup for this crate:
libcrux_traits::aead
as the main public APIs. Usage examples for these APIs are provided in the crate documentation and in theexamples/
directory.Closes #1166