Use optimized algorithm to check for Edwards torsion-freeness#1335
Use optimized algorithm to check for Edwards torsion-freeness#1335tarcieri merged 1 commit intoRustCrypto:masterfrom
Conversation
244546b to
0b51143
Compare
|
I'm not sure what the Additionally, why do we require torsion-freeness on points in the first place? I think this should be optional and not enforced by the default |
0b51143 to
cfe844b
Compare
cfe844b to
a86b193
Compare
Yes, ideally points that aren't on the curve are unrepresentable, because the constructors be it via decompression or validating that a given set of affine coordinates are valid solutions to the curve equation always ensure a valid curve point. Ideally if such a function exists you shouldn't need to make an invalid curve point first in order to check it! Rather the check can be implemented as a constructor which returns a point type only if the coordinates are valid. |
|
I did go ahead and remove both checks, |
|
Re: constructors that check affine coordinates, here's an issue for that for curve25519-dalek if you'd like to coordinate on APIs: dalek-cryptography/curve25519-dalek#817 |
The check if an Edwards point is torsion-free involves a scalar multiplication and is therefor quite expensive. This PR implements the algorithm from "Point-Halving and Subgroup Membership in Twisted Edwards Curves" to significantly reduce the computational requirements.