-
Notifications
You must be signed in to change notification settings - Fork 110
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
dsa: Add initial DSA implementation #471
Conversation
Thank you for contributing this! I'll try to do a more thorough review when I have some time. Just glancing through quickly I don't see any immediate concerns. |
@tarcieri No problem, take your time! Out of interest, would it be okay to use one of the |
Yes, it's fine to use the The |
One thing I thought I might mention before I can do a more thorough review is RFC6979 deterministic signature support. The
|
The test for the deterministic signatures is pretty messy and doesn't include all test vectors but should be good enough for a start |
A few more notes... You appear to be running into one of the problems with the current There's some discussion of that on this tracking issue: RustCrypto/traits#237 Unfortunately ASN.1 DER-encoded signatures are one of the reasons that the The way both the
Anyway, all that said this is a use case to definitely keep in mind when thinking about a hypothetical |
dsa/src/lib.rs
Outdated
#![forbid(missing_docs, unsafe_code)] | ||
#![deny(rust_2018_idioms)] |
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.
We generally use warn
rather than deny
, and enforce code is warning-free in CI
#![forbid(missing_docs, unsafe_code)] | |
#![deny(rust_2018_idioms)] | |
#![forbid(unsafe_code)] | |
#![warn(missing_docs, rust_2018_idioms)] |
(unsafe_code
is the one exception in crates where we don't want any)
dsa/src/privatekey.rs
Outdated
@@ -0,0 +1,200 @@ | |||
//! |
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.
Nit: we generally call these modules private_key.rs
which follows a camel case -> snake case conversion
dsa/src/publickey.rs
Outdated
@@ -0,0 +1,145 @@ | |||
//! |
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.
Nit: would suggest naming this file public_key.rs
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.
This is looking pretty close to an MVP. Just a few nits.
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.
Thank you!
This PR adds an initial implementation of DSA (see #8)
The following things work when tested against OpenSSL:
Things that need to be looked at:
especially verification of OpenSSL generated signatures(edit: added with commit 40e7fd2))(edit: Thesignature
compatibility (the crate itself isn't deeply integrated withsignature
and only offers compatibility wrappers (see thecompat.rs
file) Should those traits be integrated more directly?)signature
crate has been integrated more tightly with commit 7123e0f)