kokke / tiny-ECDH-c

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

coeff_a always = 1 #1

Closed caspehre closed 6 years ago

caspehre commented 6 years ago

Hi kokke, thanks for a great project! I have it working for k163 + k283. To get it working for all my cases I had to do some tweaks. The main issue was that in your algorithms, coeff_a is treated as constant 1. As far as I can see, it is only for k163 that a is 1, it is 0 for all other curves.

I'm completely new at GitHub projects, how do you want me to proceed? I have made a clone of your project, I could upload my changes there and make a pull request?

Kind regards!

kokke commented 6 years ago

Hi @caspehre and thanks a lot for reading my code :)

Please do upload your changes and make a PR. I'd really like to see how you've implemented it :)

kokke commented 6 years ago

Man you're right about me treating all curves as having parameter a = 1. How did I miss that...

I haven't tested against another implementations, because everything I could find was using curves over prime fields. That would've revealed it I think.

Thanks for pointing this out - this is exactly the reason I put things on Github. To get great feedback from great programmers :) Usually it takes 2-6 months from I create a project for the first bug report to arrive. I think this repo has been online 3-4 weeks :D

kokke commented 6 years ago

Closing after merging PR #2