-
Notifications
You must be signed in to change notification settings - Fork 49
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
feat: add AEAD open_separate_gather method #242
Conversation
aws-lc-rs/src/aead/aes_gcm.rs
Outdated
#[inline] | ||
#[allow(clippy::needless_pass_by_value)] | ||
pub(crate) fn aead_open_separate_gather( | ||
key: &AeadCtx, | ||
nonce: Nonce, | ||
aad: Aad<&[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.
Since at this level all we care about is the AAD byte-slice, should the function just take a byte-slice and avoid needing the #[allow(clippy:xxx)]
?
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 that's fine with me
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've cleaned up the code to be associated methods on UnboundKey, which gets rid of all of the wrapper functions. I've also removed the clippy allows where possible.
Working on rebasing this on latest main |
a2366b8
to
531ac7c
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #242 +/- ##
==========================================
- Coverage 95.62% 95.61% -0.02%
==========================================
Files 49 50 +1
Lines 6744 6699 -45
==========================================
- Hits 6449 6405 -44
+ Misses 295 294 -1
☔ View full report in Codecov by Sentry. |
Co-authored-by: Sean McGrail <mcgrails@amazon.com>
531ac7c
to
bca9190
Compare
I think I got everything update inline with the spirit of the changes for |
The changes look good to me! Thanks for the rebase |
Description of changes:
In #206, we added a method that avoids copying data into a target buffer when performing an AEAD sealing operation.
This PR adds a corresponding method for AEAD opening. It works by decrypting the provided ciphertext into a destination output cleartext slice.
Note that I moved all of the EVP calls to associated methods on the
UnboundKey
, rather than being spread across theaead
module as well asaead::aes_gcm
.Testing:
I've refactored the AEAD tests a bit to test all of the supported permutations of sealer and opener functions, since the current form was getting more complicated. Note that SIV algorithms don't currently support scatter/gather operations.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.