Import some ECDSA edge cases into p1363 format#237
Merged
Conversation
added 2 commits
April 21, 2026 13:10
Commit 713daee (from PR C2SP#206) added some ECDSA tests from David Benjamin, to cover a few edge cases, in particular when r is very slightly above p - n. David had submitted the tests on 23 curve/hash combinations, but only for the ASN.1/DER format for signature. This commit imports the same vectors but with signatures in IEEE p1363 format.
tob-scott-a
approved these changes
Apr 21, 2026
Contributor
tob-scott-a
left a comment
There was a problem hiding this comment.
This looks useful. I know several projects that require P1363 format.
cpu
approved these changes
Apr 21, 2026
Member
cpu
left a comment
There was a problem hiding this comment.
Thank you!
Test generation script (David's script with just a few changed)
Note that I think your script lost the import base64 at the top and I had to restore that to get it running.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Commit 713daee (from PR #206) added some ECDSA tests from David Benjamin, to cover a few edge cases, in particular when r is very slightly above p - n. David had submitted the tests on 23 curve/hash combinations, but only for the ASN.1/DER format for signature. This commit imports the same vectors but with signatures in IEEE p1363 format.
I am using the same script (reproduced below) with only the minute changes to get the encoding in the IEEE p1363 format (in function
add_test(), around lines 545-549). Since the script is deterministic, all the mathematical values are the same, only the encoding is changed.Test generation script (David's script with just a few changed)