bwesterb / py-seccure

SECCURE compatible Elliptic Curve cryptography in Python
GNU Lesser General Public License v3.0
94 stars 24 forks source link

Signature with "secp224r1/nistp224" doesn't work #4

Closed jcea closed 11 years ago

jcea commented 11 years ago

import seccure str(seccure.passphrase_to_pubkey(b'my private key', curve="secp224r1/nistp224")) '+VTV4p&TKxC6z{0?Zfju&[iBoGv%/|>s$BS' seccure.sign(b'This message will be signed\n', b'my private key',curve="secp224r1/nistp224") b'^}Hq+X#55F=Vp2d}hr>CkOJCXQiK4tP_x~At;LnZu5s50/.t8]eSKNfluiGh^q/IrUomW' seccure.verify(b'This message will be signed\n',b'^}Hq+X#55F=Vp2d}hr>CkOJCXQiK4tP_x~At;LnZu5s50/.t8]eSKNfluiGh^q/IrUomW','+VTV4p&TKxC6z{0?Zfju&[iBoGv%/|>s$BS') Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.3/site-packages/seccure/init.py", line 786, in verify p = curve.pubkey_from_string(pk, pk_format) File "/usr/local/lib/python3.3/site-packages/seccure/init.py", line 663, in pubkey_from_string return PubKey(self.point_from_string(s, fmt)) File "/usr/local/lib/python3.3/site-packages/seccure/init.py", line 661, in point_from_string return self._point_decompress(x, yflag) File "/usr/local/lib/python3.3/site-packages/seccure/init.py", line 670, in _point_decompress y = mod_root(h, m) File "/usr/local/lib/python3.3/site-packages/seccure/init.py", line 135, in mod_root h.setbit(r - m - 1) AttributeError: 'int' object has no attribute 'setbit'

bwesterb commented 11 years ago

Why is your file named _init__.py instead of __init__.py?

Are the command you run in the test suite?

I will investigate this issue in a few days.

bwesterb commented 11 years ago

Did the latest commit fix this problem for you?

bwesterb commented 11 years ago

This and another issue is solved and tested in d7ebfb7fbf4e3761bae08850d9a31a7e2972b10e