-
Notifications
You must be signed in to change notification settings - Fork 265
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
Implement the Sum
trait for all AffineCurve
#289
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.
utACK
iter.map(|x| x.into_projective()) | ||
.sum::<GroupProjective<P>>() |
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.
It would be faster to use mixed addition, no?
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.
Good point. Let me double-check. Yes, it is very likely that the conversions from affine to projective may be unnecessary as well.
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.
(though the latter is cheap)
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.
Done in #291
Description
George Gkitsas mentions that it would be convenient to have a
Sum
trait forAffineCurve
, specifically SW curve'sGroupAffine
.This PR adds the requirement that all
AffineCurve
must implement theSum
trait.It is useful to have this trait: a user who uses
+
or+=
in SW's AffineCurve indeed would pay performance overhead --- there are unnecessary conversions between ProjectiveCurve and AffineCurve during each addition. ASum
trait implementation that avoids such unnecessary conversions can significantly boost the performance.closes: #288
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 explorerFeels skippable: