You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
affine_element -> affine_point element -> jacobian_point (if I recall correctly)
And should we have a dinstinct class for when a point is in montgomery form, to make it clear? (Maybe we already do... I'm doing a lot of uninformed backseat driving by opening this issue, sorry).
(We could even go mad and give the names PascalCase).
Montgomery form would be for curves which have an Edwards form, so it would not apply for bn254 or grumkin.
Maybe you meant when the point's co-ordinates are in montgomery form, if so then I think we should not expose whether a field element is in montgomery form as its an implementation detail that should not leak through to the proving system. This is because a field element could use barret reduction to implement modular arithmetic and then you need to change your proving system code because of a change you made in your field element class. The change here would be getting rid of the to_montgomery and from_montgomery methods.
I opened an issue on gnark-crypto here for the same problem.
I think I brought up the field elements exposing montgomery form with @codygunton or maybe it was @ledwards2225
For replacing Element I think it depends on the usecases we are using. I think thats what most other libraries do. ie the concrete struct is AffinePoint, JacobianPoint and then they have an interface called Element or GroupElement which AffinePoint and JacobianPoint satisfies.
Activity
kevaundray commentedon Apr 14, 2023
Montgomery form would be for curves which have an Edwards form, so it would not apply for bn254 or grumkin.
Maybe you meant when the point's co-ordinates are in montgomery form, if so then I think we should not expose whether a field element is in montgomery form as its an implementation detail that should not leak through to the proving system. This is because a field element could use barret reduction to implement modular arithmetic and then you need to change your proving system code because of a change you made in your field element class. The change here would be getting rid of the
to_montgomeryandfrom_montgomerymethods.I opened an issue on gnark-crypto here for the same problem.
I think I brought up the field elements exposing montgomery form with @codygunton or maybe it was @ledwards2225
kevaundray commentedon Apr 14, 2023
For replacing
ElementI think it depends on the usecases we are using. I think thats what most other libraries do. ie the concrete struct is AffinePoint, JacobianPoint and then they have an interface calledElementorGroupElementwhich AffinePoint and JacobianPoint satisfies.ledwards2225 commentedon Mar 5, 2026
Sorry, Mike
iAmMichaelConnor commentedon Mar 5, 2026
Noooooooooooo :)