kokke / tiny-ECDH-c

Small portable Elliptic-Curve Diffie-Hellman in C
The Unlicense
254 stars 64 forks source link

Point multiplication is wrongly implemented as field multiplication #7

Open trstovall opened 6 years ago

trstovall commented 6 years ago

https://github.com/kokke/tiny-ECDH-c/blob/4218dcda6df6c173b155bbd11f9ad189c2458bb3/ecdh.c#L933

ecdsa_verify is using gf2field_mul instead of gf2point_mul.

kokke commented 6 years ago

Hi @trstovall and thanks for pointing out this issue :) That's a nice catch.

The user zcode1 has already made me aware of that problem in https://github.com/kokke/tiny-ECDH-c/issues/6#issuecomment-394780962 - but I haven't found time to fix it in the source code yet.

However it is not the only issue with the ECDSA code it seems, because signing / verification still doesn't work properly, at least in my testing....

I will keep this issue open until I commit changes