Closed winderica closed 3 weeks ago
I think a semantically cleaner version of this would be to add x()
and y()
operations to the CurveVar
trait.
@Pratyush Yeah that makes sense! Will add these methods, as well as xy()
, to CurveVar
.
But I still think adding ToConstraintFieldGadget
to CurveVar
is beneficial. x()
and y()
are called more likely for exposing the details of the point, while a developer may invoke to_constraint_field()
without caring about the implementation details (e.g., whether the result contains infinity
, which is true for SW points but not for TE points). What do you think?
Description
This PR adds the requirement that structs that implement
CurveVar
orFieldVar
should also implementToConstraintFieldGadget
, which could be convenient e.g. when we want to extract the underlyingFpVar
s from a genericCurveVar
without specifying+ ToConstraintFieldGadget<...>
every time.Since both implementations of
CurveVar
(i.e., SWProjectiveVar
and TEAffineVar
) and all implementations ofFieldVar
(i.e.,FpVar
,QuadExtVar
,CubicExtVar
, andEmulatedFpVar
) already implementToConstraintFieldGadget
as well, this PR does not introduce any change in the behavior of existing code.Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but write a little note why.
Pending
section inCHANGELOG.md
Files changed
in the Github PR explorer