-
Notifications
You must be signed in to change notification settings - Fork 245
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
Fix the incorrect Affine - Projective
implementation
#822
Conversation
@@ -305,14 +305,14 @@ impl<P: SWCurveConfig, T: Borrow<Self>> Sub<T> for Affine<P> { | |||
impl<P: SWCurveConfig> Sub<Projective<P>> for Affine<P> { | |||
type Output = Projective<P>; | |||
fn sub(self, other: Projective<P>) -> Projective<P> { | |||
other - self | |||
self.into_group() - other |
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.
self.into_group() - other | |
self + (-other) |
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.
Thanks for pointing out the better solution! Wasn't aware that we can do this 😂
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.
Thank you for the PR and the fix!
Description
This PR fixes the incorrect implementation of subtraction between an affine point and a projective point by flipping the position of subtrahend and minuend.
closes: #821
No performance regression due to this PR is observed (tested on Intel Core i9-12900k):
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