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

secp256k1/ecdsa: Add test for order wraparound. #3191

Merged

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Sep 21, 2023

This is rebased on #3190.

Since it is impossible to calculate the necessary values without breaking the ECDLP, this adds an invented signature to exercise the branch of the RecoverCompact function that involves the case when the original X coordinate of the random point is greater than the group order and therefore has the overflow bit set.

The result is raising the test coverage from 99.2% to 99.6%.

Before:

$ go test -cover
coverage: 99.2% of statements

After:

$ go test -cover
coverage: 99.6% of statements

@davecgh davecgh added the test coverage Discussion and pull requests for improving test coverage. label Sep 21, 2023
@davecgh davecgh added this to the 1.9.0 milestone Sep 21, 2023
Since it is impossible to calculate the necessary values without
breaking the ECDLP, this adds an invented signature to exercise the
branch of the RecoverCompact function that involves the case when the
original X coordinate of the random point is greater than the group
order and therefore has the overflow bit set.

The result is raising the test coverage from 99.2% to 99.6%.
@davecgh davecgh force-pushed the ecdsa_over_group_order_with_overflow_bit_test branch from d9e31bc to dc41075 Compare September 21, 2023 16:45
@davecgh davecgh merged commit dc41075 into decred:master Sep 21, 2023
2 checks passed
@davecgh davecgh deleted the ecdsa_over_group_order_with_overflow_bit_test branch September 21, 2023 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test coverage Discussion and pull requests for improving test coverage.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants