-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Exhaustive recovery #428
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
Merged
Merged
Exhaustive recovery #428
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…sign Whenever ecdsa_sig_sign is called, in the case that r == 0 or r overflows, we want to retry with a different nonce rather than fail signing entirely. Because of this, we always check the nonce conditions before calling sig_sign, so these checks should always pass (and in particular, they are inaccessible through the API and appear as uncovered code in test coverage).
Boosts the ECDH module to 100% coverage
Also remove `secp256k1_fe_verify` from field_*_.impl.h when VERIFY is not defined
Mathematically, we always overflow when using the exhaustive tests (because our scalar order is 13 and our field order is on the order of 2^256), but the `overflow` variable returned when parsing a b32 as a scalar is always set to 0, to prevent infinite (or practically infinite) loops searching for non-overflowing scalars.
gmaxwell
reviewed
Dec 16, 2016
| * overlap between the sets, so there are no valid signatures). */ | ||
|
|
||
| /* Verify by converting to a standard signature and calling verify */ | ||
| secp256k1_ecdsa_recoverable_signature_save(&rsig, &r_s, &s_s, recid); |
Contributor
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.
recid is used without initialization here.
d0ab623 to
2cee5fd
Compare
Contributor
Author
|
Fixed uninitialized |
Contributor
|
ACK. |
sipa
added a commit
that referenced
this pull request
Dec 28, 2016
2cee5fd exhaustive tests: add recovery module (Andrew Poelstra) 678b0e5 exhaustive tests: remove erroneous comment from ecdsa_sig_sign (Andrew Poelstra) 03ff8c2 group_impl.h: remove unused `secp256k1_ge_set_infinity` function (Andrew Poelstra) a724d72 configure: add --enable-coverage to set options for coverage analysis (Andrew Poelstra) b595163 recovery: add tests to cover API misusage (Andrew Poelstra) 6f8ae2f ecdh: test NULL-checking of arguments (Andrew Poelstra) 25e3cfb ecdsa_impl: replace scalar if-checks with VERIFY_CHECKs in ecdsa_sig_sign (Andrew Poelstra)
Contributor
|
ACK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Builds on #426. Bumps branch coverage for modules/recovery/main_impl.h to 100%.