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

Documentation: msg should be msghash #163

Closed
bitsanity opened this issue Feb 4, 2020 · 3 comments
Closed

Documentation: msg should be msghash #163

bitsanity opened this issue Feb 4, 2020 · 3 comments

Comments

@bitsanity
Copy link

It looks like the ecdsaSign() function expects the hash of a message instead of the message itself.
The Usage section could be clearer:

// msghash should be 32-byte hash of a message, e.g. sha256(msg)
// here using random data just for illustration and test
const msghash32 = randomBytes(32)

[snip]

// sign the message
const sigObj = secp256k1.ecdsaSign(msghash32, privKey)

This would also fix #132

@fanatid
Copy link
Member

fanatid commented Feb 4, 2020

Yep, would be good. Do you want submit PR?

@bitsanity
Copy link
Author

Attached patch file (had to append .txt because github doesn't recognize that file type):

fix_issue_163.patch.txt

@fanatid
Copy link
Member

fanatid commented Feb 4, 2020

Added in d9f7bf0

@fanatid fanatid closed this as completed Feb 4, 2020
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