-
Notifications
You must be signed in to change notification settings - Fork 74
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
implement ecdsa sign, verify, sign_prehashed and verify_prehashed #2120
implement ecdsa sign, verify, sign_prehashed and verify_prehashed #2120
Conversation
src/executor/host.rs
Outdated
let (sig, ri) = | ||
libsecp256k1::sign(&message, &expect_pointer_constant_size!(1, 32).into()); | ||
|
||
// NOTE: the function returns 2 slices: signature and recovery ID (AS A SLICE) |
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.
should we return a single slice instead? signature (64 bytes) + 1 recovery byte
@tomaka can I also implement ecdsa verity (should be straightforward now that we have |
if we fail to parse secret key
twiggy diff reportDifference in .wasm size before and after this pull request.
|
Yeah go ahead |
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.
Looks good, modulo avoiding the copy!
Note that I haven't properly checked if the behavior is the same as in Substrate, but it seems good. Unfortunately none of the crypto functions in I know that a team from w3f is currently writing a test framework where they give runtimes to a client and check if said client behaves properly, but it's not ready yet. |
yeah, I figured
this sounds like exactly what is needed! |
Closes #1968
Note this PR implements
ecdsa_sign
and introducesecdsa_verify
function, which are both out of the scope of the issue above.