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

allow use of custom nonce in ecdsa_sign #11

Merged
merged 1 commit into from
Jul 30, 2016
Merged

Conversation

AdamISZ
Copy link
Contributor

@AdamISZ AdamISZ commented Mar 29, 2016

As per the title. Calling code would need to build the nonce function and data with cffi and pass it in.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 95.078% when pulling 0adbf67 on AdamISZ:customnonce into b4475d9 on ludbb:master.

@ludbb
Copy link
Owner

ludbb commented Mar 29, 2016

Hi, thank you for the patch. Can you write a test where this new option is used?

@AdamISZ
Copy link
Contributor Author

AdamISZ commented Mar 29, 2016

@ludbb ok, will do.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 95.337% when pulling 3caf31d on AdamISZ:customnonce into fe2443a on ludbb:master.

#since we don't increment the counter here, that will not succeed.
#Of course the likelihood of such an error is infinitesimal.
#TLDR this is not intended to be used in real life; use
#deterministic signatures.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As briefly mentioned here, using a custom nonce function is certainly not something you'd normally want to do; the particular use case we had related to stealth addresses. The problem was that the default operation of the library ecdsa_sign does not return the value of the nonce, and this is needed in this case. A brief discussion with Greg Maxwell today indicated that there might be a possibility of having the nonce value returned in the extra data field in future in the upstream library; this would allow one to use the nonce value without using a non-default (non-rfc6979) nonce. There may be other situations where a custom nonce function is required for some reason, so one way or another this patch (which is just exposing what the underlying library offers) might conceivably be useful for someone, even given the caveats.

@ludbb ludbb merged commit 5a817ea into ludbb:master Jul 30, 2016
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.

3 participants