-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add support of customizing RNG for crypto algorithms #65
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #65 +/- ##
==========================================
+ Coverage 95.32% 95.45% +0.12%
==========================================
Files 19 20 +1
Lines 2674 2750 +76
==========================================
+ Hits 2549 2625 +76
Misses 125 125 ☔ View full report in Codecov by Sentry. |
b1d5486
to
bbb909d
Compare
6999404
to
64cfa72
Compare
492d7c3
to
55592de
Compare
bdb28aa
to
25935a1
Compare
Hi folks, I just refactor and create the wrapper type in a clearer way:
I did not change all types that contains CC: @zugzwang @xinyufort |
Current two RNG we provided in this crate does not meet FIPS requirements. So, this commit updates all crypto algorithms that need to use RNG to have a function pointer for creating RNG. In this way, user could customize the RNG they want to use for each algorithm. Other Changes: - Add unit tests. - Fix clippy warnings.
- Remove derived Debug implementation on ` agreement::Algorithm`. - Update unit test. - Improve rustdoc for `MbedRng`.
fix rustdoc warning
- Refactor and rename `KxGroup` to `KxGroupWrapper`. - Rename `KeyExchange` to `KeyExchangeImpl`. - Refactor and rename `DheKxGroup` to `DheKxGroupWrapper`. - Rename `DheActiveKeyExchange` to `DheActiveKeyExchangeImpl`. - Refactor and rename `MbedTlsPkSigningKey` to `MbedTlsPkSigningKeyWrapper`. - Update unit tests accordingly.
25935a1
to
9c6b488
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.
KxGroup
should represent either an ECDH or FFDH key exchange group.
Currently, KxGroup
represents ECDH and DheKxGroup
represents FFDH.
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.
Small nit; use either Ffdhe
or FFDhe
, not both.
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.
just one nitpick, otherwise LGTM
TL;DR
This PR picks changes in #64 to master.
Background
Current two RNG we provided in this crate does not meet FIPS requirements.
So, this PR updates all crypto algorithms that need to use RNG to have a function pointer for creating RNG. In this way, user could customize the RNG they want to use for each algorithm.
Changes
fn with_rng_provider
to enable user to choose RNG for each crypto algorithm implementation.pub
, so user could easily customize current crypto algorithm implementations.Deref
trait guard.