rdubois-crypto / FreshCryptoLib

Cryptographic Primitives for Blockchain Systems (solidity, cairo, C and rust)
MIT License
125 stars 22 forks source link

Fix ecAff_isOnCurve #66

Closed wilsoncusack closed 5 months ago

wilsoncusack commented 5 months ago

Further to #65

The description of the PR is correct in pointing out that the code accepts x and x+p < 2^256 (and similarly y and y+p < 2^256) as valid while it should only accept x and y. I believe the fix should be adding an additional check that validates if x < p && y < p. Putting it all together, I think the following change should be made:

https://github.com/rdubois-crypto/FreshCryptoLib/pull/65#issuecomment-2037277371

rdubois-crypto commented 5 months ago

Fix assures canonic representation (unicity) of a point. OK.