-
Notifications
You must be signed in to change notification settings - Fork 4
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
Conversation
There was a problem hiding this 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
} | ||
} | ||
|
||
impl<C: SwCurveConfig> Curve for ElementP2<C> { |
There was a problem hiding this comment.
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.
impl<C: SwCurveConfig> Curve for ElementP2<C> { | |
impl<C: ark_ec::short_weierstrass::SWCurveConfig + Curve> Curve for ElementP2<C> { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>>
🎉 This PR is included in version 3.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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