Skip to content
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

Streaming API for CBC and CTR cipher modes #410

Merged
merged 8 commits into from
Jun 21, 2024
Merged

Conversation

justsmth
Copy link
Contributor

@justsmth justsmth commented Apr 26, 2024

Issues

Description

  • New structs StreamingEncryptionKey and StreamingDecryptionKey supporting operations with AES128 and AES256 in CTR and CBC (w/ PKCS7 padding) modes
    • The update and final functions return a BufferUpdate struct indicating where the provided output buffer was modified.
  • Added example to cipher module documentation.
  • Added tests.

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.

@justsmth justsmth force-pushed the stream-cipher branch 2 times, most recently from 0159744 to bfc9171 Compare April 30, 2024 16:57
@justsmth justsmth force-pushed the stream-cipher branch 6 times, most recently from 525aa5b to 88e3b68 Compare May 7, 2024 18:17
@codecov-commenter
Copy link

codecov-commenter commented May 7, 2024

Codecov Report

Attention: Patch coverage is 94.03974% with 27 lines in your changes missing coverage. Please review.

Project coverage is 92.83%. Comparing base (c358484) to head (0a75b01).
Report is 29 commits behind head on main.

Files Patch % Lines
aws-lc-rs/src/cipher/streaming.rs 93.98% 13 Missing and 14 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #410      +/-   ##
==========================================
- Coverage   95.80%   92.83%   -2.97%     
==========================================
  Files          61       62       +1     
  Lines        8143     8626     +483     
  Branches        0     8626    +8626     
==========================================
+ Hits         7801     8008     +207     
- Misses        342      362      +20     
- Partials        0      256     +256     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@justsmth justsmth force-pushed the stream-cipher branch 5 times, most recently from 63c1f6e to c30f142 Compare May 9, 2024 13:52
aws-lc-rs/src/cipher.rs Outdated Show resolved Hide resolved
aws-lc-rs/src/cipher.rs Show resolved Hide resolved
aws-lc-rs/src/cipher/streaming.rs Show resolved Hide resolved
aws-lc-rs/src/cipher/streaming.rs Show resolved Hide resolved
aws-lc-rs/src/cipher/streaming.rs Outdated Show resolved Hide resolved
aws-lc-rs/src/cipher/streaming.rs Outdated Show resolved Hide resolved
aws-lc-rs/src/cipher/streaming.rs Show resolved Hide resolved
aws-lc-rs/src/cipher/streaming.rs Outdated Show resolved Hide resolved
@justsmth justsmth force-pushed the stream-cipher branch 6 times, most recently from f6e182c to 05e253e Compare May 24, 2024 13:50
@justsmth justsmth changed the title [DRAFT] Streaming API for cipher Streaming API for cipher May 24, 2024
@justsmth justsmth changed the title Streaming API for cipher Streaming API for CBC and CTR cipher modes May 24, 2024
@justsmth justsmth marked this pull request as ready for review May 24, 2024 14:29
@justsmth justsmth requested a review from a team as a code owner May 24, 2024 14:29
@justsmth
Copy link
Contributor Author

Some CI jobs are failing due to the the "nightly" Rust compiler panicking. The issue is reported here: rust-lang/rust#125474

aws-lc-rs/src/cipher/streaming.rs Outdated Show resolved Hide resolved
aws-lc-rs/src/cipher/streaming.rs Outdated Show resolved Hide resolved
aws-lc-rs/src/cipher/streaming.rs Outdated Show resolved Hide resolved
aws-lc-rs/src/cipher/streaming.rs Outdated Show resolved Hide resolved
aws-lc-rs/src/cipher/streaming.rs Outdated Show resolved Hide resolved
aws-lc-rs/src/cipher/streaming.rs Show resolved Hide resolved
aws-lc-rs/src/cipher/streaming.rs Show resolved Hide resolved
@justsmth justsmth force-pushed the stream-cipher branch 4 times, most recently from ee7d6db to 18f67e2 Compare June 7, 2024 13:10
@justsmth justsmth requested a review from skmcgrail June 7, 2024 14:17
Copy link
Member

@skmcgrail skmcgrail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some final comments that you can decide to take or not.

aws-lc-rs/src/cipher/streaming.rs Show resolved Hide resolved
aws-lc-rs/src/cipher/streaming.rs Show resolved Hide resolved
aws-lc-rs/src/cipher/streaming.rs Show resolved Hide resolved
@justsmth justsmth merged commit 6f3885f into aws:main Jun 21, 2024
189 checks passed
@justsmth justsmth deleted the stream-cipher branch June 21, 2024 20:30
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.

Support streaming API for CBC
5 participants