-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add VerifyLowS helper function to ECDSA signature #2463
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
base: master
Are you sure you want to change the base?
Conversation
GustavoStingelin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to add unit tests covering the VerifyLowS function.
Introduce a VerifyLowS helper to detect non-canonical high-S ECDSA signatures, along with unit tests.
|
Thanks @GustavoStingelin for the review — tests have been added. |
GustavoStingelin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could rename the table test fields to be more readable
| signatureTests := []struct { | ||
| name string | ||
| sig []byte | ||
| isLowS error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| isLowS error | |
| wantErr error |
| } | ||
|
|
||
| for _, test := range signatureTests { | ||
| isLowS := VerifyLowS(test.sig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| isLowS := VerifyLowS(test.sig) | |
| err := VerifyLowS(test.sig) |
Fix #2462
Add VerifyLowS helper function to ECDSA signature. It will be used on lightningnetwork/lnd#10372.