-
Notifications
You must be signed in to change notification settings - Fork 158
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
Flawed implementation in ecdsa signature #427
Comments
Thank you for letting us know. I implemented the fix in #428. |
Keeping the issue open until new releases can be released. |
Thank you 👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The signature generated by
gnark-crypto/ecc/secp256k1/ecdsa
cannot be verified by other libraries (including but not limited to NodeJS). After digging into the problem, this seems a pretty serious flaw, people now can easily find a collision in the signature hash and produce a fake verification.Use a pretty trivial way to generate a random key and sign a message
Plug the values into a simple Node JS program, it turns out:
The complete test code is available in here https://github.com/samngmco/gnark-bug
The root cause:
In
gnark-crypto@v0.9.1/ecc/secp256k1/ecdsa/ecdsa.go
Signature verification is also calling the same
HashToInt()
, that's why the signature verification passed within gnark-crypto.The text was updated successfully, but these errors were encountered: