Conversation
keks
left a comment
There was a problem hiding this comment.
I think this looks pretty good! I left some comments for feedback. I also noticed that there are a few public items (I think just modules?) that do not have a doc comment, I guess these are what you had in mind with the documentation todo in the PR?
dad5321 to
e1dbc7e
Compare
| /// An error when verifying a signature. | ||
| #[derive(Debug)] | ||
| pub enum VerificationError { | ||
| // TODO: add doc comment. |
There was a problem hiding this comment.
These todos should get resolvec
| // TODO: add doc comment. | ||
| MalformedHintError, | ||
| // TODO: add doc comment. | ||
| SignerResponseExceedsBoundError, |
There was a problem hiding this comment.
Error names usually shouldn't contain "error".
| @@ -0,0 +1,721 @@ | |||
| //! This module includes key-centric and slice-based APIs for ML-DSA. | |||
There was a problem hiding this comment.
This module looks like it's duplicate lots of code and adds way more APIs we need to maintain.
Do you intend to maintain all APIs or drop some?
It looks like this is true for all new APIs in this PR.
| pub mod signature; | ||
|
|
||
| pub use libcrux_secrets; | ||
| pub use rand; |
There was a problem hiding this comment.
Should this go behind a rand feaure?
I see we include it unconditionally already. So this may be something for a follow up to clean up.
| //! | ||
| //! // generate a new signature keypair | ||
| //! use rand::TryRngCore; | ||
| //! let mut rng = rand::rngs::OsRng; |
There was a problem hiding this comment.
Using rng's in this way suggests that we think its' a good idea. We shouldn't do that and at least add a comment about using proper rngs.
| version.workspace = true | ||
|
|
||
| [dependencies] | ||
| libcrux-ecdsa = { version = "0.0.4", path = "../../algorithms/ecdsa", optional = true } |
There was a problem hiding this comment.
We should use workspace dependencies evereywhere.
|
|
||
| [dev-dependencies] | ||
| # used for rustdocs | ||
| libcrux-signature = { path = "../crates/primitives/signature" } |
There was a problem hiding this comment.
workspace dependency? I'm not sure this can be built on docs.rs.
| "expose-hacl", | ||
| ] } | ||
| libcrux-macros = { version = "=0.0.3", path = "../../utils/macros" } | ||
| libcrux-traits = { version = "=0.0.4", path = "../../../traits" } |
There was a problem hiding this comment.
workspace dependencies?
| "expose-hacl", | ||
| ] } | ||
| libcrux-sha2 = { version = "=0.0.4", path = "../sha2" } | ||
| libcrux-secrets = { version = "=0.0.4", path = "../../utils/secrets" } |
There was a problem hiding this comment.
Workspace dependencies?
| ); | ||
| } | ||
|
|
||
| #[test] |
There was a problem hiding this comment.
Should these go into a test module?
|
@wysiwys: We should discuss whether this is in good state at the moment. |
|
As discussed offline, I'll take over here, rebase and work towards a slightly scaled back version that exposes the key centric APIs on the already existing types. |
libcrux-ml-dsa,libcrux-ed25519, andlibcrux-ecdsalibcrux-traitscrate that reduce boilerplate in signature API implementations in crateslibcrux-signaturecratesign_mut()inlibcrux-ml-dsa(moved from the change in Signature traits #1080 )Resolves #1034