PointyCastle / pointycastle

Moved into the Bouncy Castle project: https://github.com/bcgit/pc-dart
MIT License
270 stars 76 forks source link

add normalize option for ecdsa signatures #217

Closed cheeseandcereal closed 4 years ago

cheeseandcereal commented 4 years ago

Fixes #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 this comment in libsecp256k1 for more information: https://github.com/bitcoin-core/secp256k1/blob/d644dda5c9dbdecee52d1aa259235510fdc2d4ee/include/secp256k1.h#L483-L513

cheeseandcereal commented 4 years ago

@stevenroose This is my first pass according to what we talked about in #215

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

cheeseandcereal commented 4 years ago

@stevenroose any word about getting this merged, or point me to some other place to submit this change since the repository may have moved?

AKushWarrior commented 4 years ago

https://github.com/bcgit/pc-dart

stevenroose commented 4 years ago

Yeah I would suggest to direct your PR to the bouncy castle project repo. They have taken over this project and are in charge of merging new features.

I'm sorry I can't be of help, I don't have time anymore to maintain this project, which is why I left it to the Bouncy Castle team.

cheeseandcereal commented 4 years ago

No worries steven!

Submitted and merged upstream https://github.com/bcgit/pc-dart/pull/10

Thanks guys