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

add normalize option for ecdsa signatures #10

Closed
wants to merge 1 commit into from

Conversation

cheeseandcereal
Copy link
Contributor

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

Signed-off-by: Adam Crowder <adam@adamcrowder.net>
@mwcw
Copy link
Collaborator

mwcw commented May 25, 2020

Thanks for the patch.

We have committed some updates for doing normalization based on this which avoid having to make ECSignature mutable and that should allow a Normalising Signer to be injected in place of one which does not do normalization.

We have also added optional enforcement of normalization on verification.

It has been added to "ecdsa_signer_test.dart".

Thanks again, any feedback please let us know.

MW

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

Successfully merging this pull request may close these issues.

2 participants