Conversation
pipermerriam
approved these changes
Dec 11, 2020
Member
|
Can you look at giving me some guidance on whether we should be backporting this to older releases? |
Contributor
Author
|
@pipermerriam |
CarlBeek
approved these changes
Dec 14, 2020
Collaborator
CarlBeek
left a comment
There was a problem hiding this comment.
This could have caused some seriously hard-to-track errors. I'm happy it was caught! :)
Member
|
Are ya'll ready for a release with this in it? |
Contributor
Author
|
I may have some minor updates in the queue that could be included in the next release together this week. |
pacrob
pushed a commit
to pacrob/py_ecc
that referenced
this pull request
Apr 18, 2024
* Ignore all __pycache__ directories * Newsfragment * Revert Newsfragment
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 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.
What was wrong?
Bounty hunter Nguyen Thoi Minh Quan found this issue:
"inv0(x): This function returns the multiplicative inverse of x in
F, extended to all of F by fixing inv0(0) == 0"
I.e. inv(0, 7) = inv(7, 7) = 0
In finite field F_7: 0 = 7.
How was it fixed?
Nguyen Thoi Minh Quan:
py_ecc/py_ecc/utils.py
Line 24 in dd38b1f
Assign a = a % n in the 1st line of the function prime_field_inv
My first quick scan is that this edge case would not happen via BLS API calls. Also, py-ecc is not a constant-time implementation. Anyway, good to be more careful. 👍
secp256k1also has aninvfunction.py_ecc/py_ecc/secp256k1/secp256k1.py
Lines 46 to 56 in dd38b1f
However, unlike BLS, the
a == ncase is undefined here so I didn't change this function./cc @JustinDrake