Add affine_xy, affine_x, affine_y functions to CurveVar#190
Merged
Pratyush merged 7 commits intoarkworks-rs:masterfrom Mar 2, 2026
Merged
Add affine_xy, affine_x, affine_y functions to CurveVar#190Pratyush merged 7 commits intoarkworks-rs:masterfrom
Pratyush merged 7 commits intoarkworks-rs:masterfrom
Conversation
Pratyush
reviewed
Oct 1, 2025
src/groups/mod.rs
Outdated
| /// A variable that represents a curve point for | ||
| /// the curve `C`. | ||
| pub trait CurveVar<C: CurveGroup, ConstraintF: PrimeField>: | ||
| pub trait CurveVar<C: CurveGroup, ConstraintF: PrimeField, F: FieldVar<C::BaseField, ConstraintF>>: |
Member
There was a problem hiding this comment.
It would be better to add this as an associated type, as it would avoid updating every usage of CurveVar.
Pratyush
reviewed
Oct 2, 2025
src/groups/mod.rs
Outdated
| + for<'a> Mul<&'a EmulatedFpVar<C::ScalarField, ConstraintF>, Output = Self> | ||
| + MulAssign<EmulatedFpVar<C::ScalarField, ConstraintF>> | ||
| { | ||
| type F: FieldVar<C::BaseField, ConstraintF>; |
Member
There was a problem hiding this comment.
Can you please rename this to BaseFieldVar?
Contributor
Author
|
Hi @Pratyush , I'm just checking in on this PR as it's been a while since the last update. I'm still very interested in getting this merged. Please let me know if there's anything else you'd like me to address. Thanks! |
Pratyush
approved these changes
Dec 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
I've added affine_x, affine_y, and affine_xy methods to the CurveVar trait. To support this, the CurveVar trait was modified to take a generic type F: FieldVar<C::BaseField, ConstraintF>. Consequently, pairing-related Var have been updated.
In the implementation, AffineVar simply returns self.x and self.y. For ProjectiveVar, it first calls to_affine() and then returns the x and y coordinates.
closes: #189
Pendingsection inCHANGELOG.mdFiles changedin the Github PR explorer