Skip to content
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

Added uECC_sign_recoverable for signing with recovery ID #80

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lionello
Copy link

This is only the first step to getting full "recovery ID" support.

The recovery ID ("recid") allows one to recover the public key from a ECDSA signature.

TODO: create a verify/recover method for doing the actual recovery; add deterministic version.

@@ -1233,6 +1233,7 @@ static int uECC_sign_with_k(const uint8_t *private_key,
const uint8_t *message_hash,
unsigned hash_size,
uECC_word_t *k,
uint8_t *recid,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding another parameter, you could return the recid in the first byte of k. That would reduce the overhead when people don't care about the recid.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh, that looks quite hacky. And uECC_sign_with_k is a static function, only used internally.

@kmackay
Copy link
Owner

kmackay commented May 26, 2016

It looks good to me, but presumably people might also want to get the recid for a deterministic signature. Maybe it would be better after all to just add a recid parameter to uECC_sign() and uECC_sign_deterministic() (and keep uECC_sign_with_k() the way you have it, ignore my comment). What do you think?

@lionello
Copy link
Author

Yeah, I thought about that. I still have a slight preference for making new functions. This avoids adding a parameter that many [all of the current] users don't care about. Adding a function is very little overhead.

I'll add the deterministic version.

alexbaloc added a commit to alexbaloc/micro-ecc that referenced this pull request Jul 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants