add normalize option for ecdsa signatures #10
Closed
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.
Related to this issue before the repository was moved: PointyCastle/pointycastle#215
Adds option to normalize ecdsa signatures to their lower-s form, required by some ecdsa libraries in an effort to prevent signature malleability
See the above linked issue as well as this comment in libsecp256k1 for more information: https://github.com/bitcoin-core/secp256k1/blob/d644dda5c9dbdecee52d1aa259235510fdc2d4ee/include/secp256k1.h#L483-L513
I imlpemented the normalize function on ECSignature which requires the ECDomainParameters, as well as an optional named boolean parameter normalize on the generateSignature signer function as well
Also included tests to show the functionality working