-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove ristretto255 trait implementations #83
Comments
Hey @str4d, thanks for looking into the code!
What am I missing? About the x/y coordinates - I agree, there's an error there. In practice we never use the coordinates so I think we will make it unimplemented as well. However, I don't see how it relates to your first point? |
Exactly as that documentation says, it provides group operations on the Curve25519 elliptic curve, and on the prime-order Ristretto group. I strongly recommend reading the
In short, |
I see your point. You are concerned because we named the trait in this library When you use this outside this is the names you see:
If we were to rename |
I noticed today that the
curv
traits are implemented forristretto255
.ristretto255
is an abstract group, not an elliptic curve. See the ristretto255 RFC draft for more details. Thecurv
traits provide APIs for elliptic curves, and thus it is a type error to implement them forristretto255
.I briefly looked at the trait implementation, and found an example of where the type error manifests as an implementation error:
https://github.com/KZen-networks/curv/blob/b326b2708560eaa0e8fd86f2c2d7d20d6eafbdce/src/elliptic/curves/curve_ristretto.rs#L278-L289
Besides the fact that
ristretto255
elements do not have coordinates, this code is parsing an encodedristretto255
element (which includes the representation of a field element modulo p = 2255 - 19) as aristretto255
scalar (which are field elements modulo ℓ = 2252 + 27742317777372353535851937790883648493), which is a type error, and returns a scalar that has been reduced from a field element, losing information.The text was updated successfully, but these errors were encountered: