Skip to content
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

feat!: extend MsmHandle to interoperate more easily with affine elements (PROOF-831) #29

Merged
merged 9 commits into from
May 29, 2024

Conversation

rnburn
Copy link
Contributor

@rnburn rnburn commented May 29, 2024

Rationale for this change

Make it more easy to work with elements in affine form using MsmHandle.

What changes are included in this PR?

Add the trait SwMsmHandle to extent MsmHandle with methods for affine points.

Are these changes tested?

Yes

@rnburn rnburn changed the title feat: extend msm handle to interoperate with affine elements (PROOF-831) feat: extend msm handle to interoperate more easily with affine elements (PROOF-831) May 29, 2024
@rnburn rnburn changed the title feat: extend msm handle to interoperate more easily with affine elements (PROOF-831) feat: extend MsmHandle to interoperate more easily with affine elements (PROOF-831) May 29, 2024
@rnburn rnburn requested a review from JayWhite2357 May 29, 2024 03:42
JayWhite2357
JayWhite2357 previously approved these changes May 29, 2024
Copy link
Contributor

@JayWhite2357 JayWhite2357 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I added a few small suggestions if you want to implement them.

src/compute/curve.rs Outdated Show resolved Hide resolved
}
}

impl<C: SwCurveConfig> Curve for ElementP2<C> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing this would remove the need for the new SwCurveConfig trait and would let you impl Curve for ark_bls12_381::g1::Config. It's not really a Curve, but you could rename the trait to CurveId if you don't like the Curve name at that point.

Suggested change
impl<C: SwCurveConfig> Curve for ElementP2<C> {
impl<C: ark_ec::short_weierstrass::SWCurveConfig + Curve> Curve for ElementP2<C> {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed to an associated constant. I kept SwCurveConfig since it's used to constrain the extension trait SwMsmHandle.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could do this to get around that:
impl<C: ark_ec::short_weierstrass::SWCurveConfig + CurveId + Clone> SwMsmHandle for MsmHandle<ElementP2<C>>

src/compute/fixed_msm.rs Outdated Show resolved Hide resolved
@rnburn rnburn changed the title feat: extend MsmHandle to interoperate more easily with affine elements (PROOF-831) feat!: extend MsmHandle to interoperate more easily with affine elements (PROOF-831) May 29, 2024
@rnburn rnburn requested a review from JayWhite2357 May 29, 2024 22:49
@rnburn rnburn merged commit d181165 into main May 29, 2024
7 checks passed
@rnburn rnburn deleted the wsif-PROOF-831 branch May 29, 2024 23:50
@SxT-Release
Copy link

🎉 This PR is included in version 3.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants