vbuterin / pybitcointools

SImple, common-sense Bitcoin-themed Python ECC library
1.28k stars 857 forks source link

Changing the der_encode_sig padding decision to avoid non-canonical sign... #65

Open nelisky opened 9 years ago

nelisky commented 9 years ago

...atures.

The negative number detection for R and S was flawed, sometimes creating non-canonical signatures where no padding was added to negative numbers, so I followed what was done here: https://code.google.com/p/bitcoinj/source/browse/core/src/main/java/com/google/bitcoin/crypto/TransactionSignature.java?r=354446dd40d7153ce5197e01c8a1ffe6b705bae3#94 which fixed the problem for me.

nelisky commented 9 years ago

Applied on top of current master HEAD