-
Notifications
You must be signed in to change notification settings - Fork 791
feat: convert signing to k256 #72
Conversation
@gakonst Georgios, you should be able to fix the PR and use it now |
Signature verification works now with the new method added here RustCrypto/elliptic-curves#205. We're only missing a method to also sign a prehashed message now, to replace the |
//! This is a helper module used to pass the pre-hashed message for signing to the | ||
//! `sign_digest` methods of K256. |
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.
It might be a bit more straightforward to use RecoverableSignPrimitive:: try_sign_recoverable_prehashed
(which is impl'd on k256::Scalar
) for this:
https://docs.rs/ecdsa/0.8.3/ecdsa/hazmat/trait.RecoverableSignPrimitive.html
The API to compute an ephemeral scalar with RFC6979 is public:
https://docs.rs/ecdsa/0.8.3/ecdsa/rfc6979/fn.generate_k.html
You can convert the raw message digest to a scalar using Scalar::from_bytes_reduced
Supersedes #67 by @roynalnaruto (rebased / cherry picked on master due to lots of changes since the original PR)