vbuterin / pybitcointools

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

Tests failing (ecdsa signing/verification) #145

Open wizardofozzie opened 7 years ago

wizardofozzie commented 7 years ago
======================================================================
FAIL: test_all (__main__.TestTransaction)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/private/var/mobile/Containers/Shared/AppGroup/AA78F2EC-3EE8-40F4-A318-8A9AB1BCB5FF/Pythonista3/Documents/pybitcointools-vbuterin/test.py", line 179, in test_all
    self.assertTrue(verify_tx_input(tx1, 0, mscript, sig1, pubs[1]), "Verification Error")
AssertionError: Verification Error

======================================================================
FAIL: test_all (__main__.TestTransactionSignVerify)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/private/var/mobile/Containers/Shared/AppGroup/AA78F2EC-3EE8-40F4-A318-8A9AB1BCB5FF/Pythonista3/Documents/pybitcointools-vbuterin/test.py", line 133, in test_all
    "Verification error"
AssertionError: Verification error

----------------------------------------------------------------------
Ran 18 tests in 6.944s

FAILED (failures=2, errors=2)

I'm quite certain this will be an issue with the implementation of ecdsa_sign whereby s = s if s < N//2 else N-s

wizardofozzie commented 7 years ago

Fixed! See my fork code and here