Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger committed Mar 8, 2024
1 parent bf3f374 commit f20f93f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/starknet-types-core/src/curve/affine_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ impl core::ops::Neg for &AffinePoint {
type Output = AffinePoint;

fn neg(self) -> AffinePoint {
AffinePoint(ShortWeierstrassProjectivePoint::from_affine(self.x().0, -self.y().0).unwrap())
// AffinePoint(ShortWeierstrassProjectivePoint::from_affine(self.x().0, -self.y().0).unwrap())
AffinePoint(self.0.neg())
}
}

Expand Down Expand Up @@ -84,6 +85,7 @@ mod test {
),
)
.unwrap()
)
);
assert_eq!(-&AffinePoint::identity(), AffinePoint::identity());
}
}

0 comments on commit f20f93f

Please sign in to comment.