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

btcec signature Verification should pass the preimage #1350

Open
dabura667 opened this issue Nov 25, 2018 · 2 comments
Open

btcec signature Verification should pass the preimage #1350

dabura667 opened this issue Nov 25, 2018 · 2 comments

Comments

@dabura667
Copy link

https://twitter.com/pwuille/status/1063582706288586752?s=19

Notice: ECDSA signatures where the message isn't a hash and chosen by the "signer" are insecure.

Given public key P, pick random nonzero values a and b. Compute R=aG+bP. Now (R.x, R.x/b) is a valid signature for "message" (R.x*a/b).

Verify should take the preimage as []byte and double SHA256 it.

Current method can be renamed VerifyUnsafe.

@Roasbeef
Copy link
Member

and double SHA256 it.

It's a generic secp256k1 library, also one can use any hash function to verify an ECDSA signature.

@dabura667
Copy link
Author

pass a hash.Hash interface as well and perform the hash within Verify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants