AntonKueltz / fastecdsa

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

About message #34

Closed cadefoster117 closed 5 years ago

cadefoster117 commented 5 years ago

How can I manual insert my hashed message and check signature?

cadefoster117 commented 5 years ago

I found a way.... I change in ecdsa.py line 80: from hashed = hashfunc(msg_bytes(msg)).hexdigest() to hashed = msg then m = "7bb2ce8b18b5dfc9c2c7e9b42fd59a94014adb06407c45f7adf69fbf4737129a" and its working well btw... very fast and great gob!

AntonKueltz commented 5 years ago

This will be supported out of the box via pull request #31.

AntonKueltz commented 5 years ago

Now supported out of the box in v1.7.2 -

from fastecdsa.curve import P256
from fastecdsa.ecdsa import sign
from fastecdsa.keys import gen_keypair

d, _ = gen_keypair(P256)
h = '7bb2ce8b18b5dfc9c2c7e9b42fd59a94014adb06407c45f7adf69fbf4737129a'
sign(h, d, prehashed=True)