AntonKueltz / fastecdsa

Python library for fast elliptic curve crypto
https://pypi.python.org/pypi/fastecdsa
The Unlicense
263 stars 76 forks source link

Adding kwarg for ecdsa.verify #56

Closed NotStatilko closed 3 years ago

NotStatilko commented 4 years ago
from fastecdsa import curve, keys, ecdsa
from hashlib import sha3_256

privkey = 83226097780307149601724191308982659071450702181348521180119679417305195215335

pubkey = keys.get_public_key(privkey, curve=curve.secp256k1)
h_msg = sha3_256(b'Hello, World!')

sign = (21908507675709627906796165908406455539873844184897317472973400044916991276309, 27557686832709986269003980395223929342356769832821050198553183871916697048026)

print(ecdsa.verify(sign, h_msg, pubkey,
    curve=curve.secp256k1, prehashed=True)
)
NotStatilko commented 4 years ago

Kwarg prehashed. Idk what with commit messages, so sorry

AntonKueltz commented 4 years ago

Left some comments on the file, only other thing I would add is please add some test cases to verify the behavior you expect. Thanks!

AntonKueltz commented 3 years ago

Merged and released in v2.1.4, sorry again for the delay merging.

NotStatilko commented 3 years ago

Thank you very much!