-
Notifications
You must be signed in to change notification settings - Fork 11
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
Update AffineCurve equal method to account for points at infinity #281
Conversation
…inite points on the elliptic curve
…ent points at infinity in elliptic curve
… of PointAtInfinity and FinitePoint
… the other is not
…eFromAffine function
…clude x and y coordinates for consistency
…oordinates for better representation of PointAtInfinity
…o use object destructuring for cleaner code and improve readability
…nity for type consistincey
…ineOnCurve function to destructure parameters and use them directly in calculations
…ntAtInfinity functions as they are not being used in the codebase
This change causes a bubble-up effect in o1js as well, can you address this in a parent PR into o1js? If this introduces any breaking changes, we should consider targeting V2 if we cannot avoid breaking the API |
I'll link the parent PR in this PR. |
Summary
This PR addresses an issue with the the
equal()
method inAffineCurve
. The method ignores the possibility of either point in the comparison being a point at infinity.Impact
This issue could lead to equality checks that may succeed when they should fail, or vice versa, when the point at infinity is involved.
Changes
PointAtInfinity
andFinitePoint
were added.GroupAffine
was updated to be a union type of thePointAtInfinity
andFinitePoint
.equal
method inCreateCurveAffine
was implemented to correctly handle the cases when either point is at infinity.o1js: o1-labs/o1js#1758