-
Notifications
You must be signed in to change notification settings - Fork 93
Adds AES CBC mode no padding #895
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #895 +/- ##
==========================================
- Coverage 95.80% 92.36% -3.44%
==========================================
Files 61 73 +12
Lines 8143 9659 +1516
Branches 0 9659 +9659
==========================================
+ Hits 7801 8922 +1121
- Misses 342 450 +108
- Partials 0 287 +287 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I agree this is a bit confusing, but the existing ECB mode for EncryptKey and DecryptKey also behaves the same way, that is to require input size to be block-aligned. There is the "skull emoji" DANGER message that will be shown on the docs.rs, I think it already push consumers off of these API, save for those who understands the intricacies of ECB mode. The larger API/feature flag refactoring is beyond what I can single handedly do. Let me know how I can help here. Thanks. |
Issues:
See SIM P307101963
Description of changes:
Currently, only the PaddedBlock keys and Streaming keys supports CBC mode.
This adds CBC mode for EncryptingKey and DecryptingKey. This allows AES CBC encryption/decryption with no padding.
Call-outs:
Since no padding is used, input data must be block aligned, length of input must be a multiple of 16 bytes.
I also included the
DANGERmessage in the doc string, since I think the use of this is unconventional.Testing:
Unit tests added following examples of existing unit tests.
KAT
Added known-answer tests from "Appendix F" of SP800-38a:
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.