-
Notifications
You must be signed in to change notification settings - Fork 2.2k
ECSignature: fixes for canonical signatures #220
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,8 +103,8 @@ | |
| "i": 1 | ||
| }, | ||
| "scriptSignature": { | ||
| "hex": "3045022100cde1302d83f8dd835d89aef803c74a119f561fbaef3eb9129e45f30de86abbf9022006ce643f5049ee1f27890467b77a6a8e11ec4661cc38cd8badf90115fbd03cefff", | ||
| "hashType": 255 | ||
| "hex": "3045022100cde1302d83f8dd835d89aef803c74a119f561fbaef3eb9129e45f30de86abbf9022006ce643f5049ee1f27890467b77a6a8e11ec4661cc38cd8badf90115fbd03cef81", | ||
| "hashType": 129 | ||
| }, | ||
| "DER": "3045022100cde1302d83f8dd835d89aef803c74a119f561fbaef3eb9129e45f30de86abbf9022006ce643f5049ee1f27890467b77a6a8e11ec4661cc38cd8badf90115fbd03cef", | ||
| "signature": { | ||
|
|
@@ -131,23 +131,47 @@ | |
| "DER": [ | ||
| { | ||
| "exception": "Invalid sequence length", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These test data amendments were because the R, S values were negative. |
||
| "hex": "30ff0204ffffffff0204ffffffff" | ||
| "hex": "30ff020400ffffff020400ffffff" | ||
| }, | ||
| { | ||
| "exception": "Invalid sequence length", | ||
| "hex": "300c0304ffffffff0304ffffffff0000" | ||
| "hex": "300c030400ffffff030400ffffff0000" | ||
| }, | ||
| { | ||
| "exception": "Expected a DER integer", | ||
| "hex": "300cff04ffffffff0204ffffffff" | ||
| "hex": "300cff0400ffffff020400ffffff" | ||
| }, | ||
| { | ||
| "exception": "Expected a DER integer \\(2\\)", | ||
| "hex": "300c0202ffffffff0204ffffffff" | ||
| "hex": "300c020200ffffff020400ffffff" | ||
| }, | ||
| { | ||
| "exception": "Invalid DER encoding", | ||
| "hex": "300c0204ffffffff0202ffffffff" | ||
| "hex": "300c020400ffffff020200ffffff" | ||
| }, | ||
| { | ||
| "exception": "R length is zero", | ||
| "hex": "30080200020400ffffff" | ||
| }, | ||
| { | ||
| "exception": "S length is zero", | ||
| "hex": "3008020400ffffff0200" | ||
| }, | ||
| { | ||
| "exception": "R value is negative", | ||
| "hex": "300c0204ffffffff020400ffffff" | ||
| }, | ||
| { | ||
| "exception": "S value is negative", | ||
| "hex": "300c020400ffffff0204ffffffff" | ||
| }, | ||
| { | ||
| "exception": "R value excessively padded", | ||
| "hex": "300c02040000ffff020400ffffff" | ||
| }, | ||
| { | ||
| "exception": "S value excessively padded", | ||
| "hex": "300c020400ffffff02040000ffff" | ||
| } | ||
| ] | ||
| } | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this suitable? Or should we just enforce
secp256k1as we have in other parts. If so, the signature length is at most going to be less than 73 bytes if so, as enforced by the reference implementation.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.
I support enforcing
secp256k1until we have a need for supporting other curvesThere 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.
That won't help us if we ever use another
ecdsa(with its ownECSignature) library other than the one currently included.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.
We can worry about it then?