-
Notifications
You must be signed in to change notification settings - Fork 562
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
ECDSA producing unverifiable or incorrect signatures for some curves #2841
Comments
Initially I wonder if the private key being 1 was triggering some corner case but using random integers instead changes nothing. If I change this
to this
everything works. Also it is probably not a coincidence that the effected curves all have an order of unusual size (161 bits for the I suspect there is a discrepancy between |
Confirmed. Using e = 0x02A0402B9AA8650342D98EECC73519850BAEF6F5 but using "Raw" plus pre-hash the mr is e = 0x01502015CD543281A16CC776639A8CC285D77B7AA3 |
I've run into such issues with Cryptofuzz myself. With these curves the size of the prime is not equal to the size of the curve (order is one bit larger than prime). So maybe you are using the prime size instead of the order size during truncation. |
This bug turned out to be because we had two distinct pieces of code that were trying to shift the hash to fit into the group order, and they occasionally would get in each others way. This is fixed now on |
prints:
The text was updated successfully, but these errors were encountered: