diff --git a/crates/starknet-types-core/src/curve/affine_point.rs b/crates/starknet-types-core/src/curve/affine_point.rs index b86d017..0adacc9 100644 --- a/crates/starknet-types-core/src/curve/affine_point.rs +++ b/crates/starknet-types-core/src/curve/affine_point.rs @@ -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()) } } @@ -84,6 +85,7 @@ mod test { ), ) .unwrap() - ) + ); + assert_eq!(-&AffinePoint::identity(), AffinePoint::identity()); } }