From f20f93fe8643846d3c1caaf070e6819bf7c73b0c Mon Sep 17 00:00:00 2001 From: Thomas Coratger Date: Fri, 8 Mar 2024 16:35:20 +0100 Subject: [PATCH] fix --- crates/starknet-types-core/src/curve/affine_point.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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()); } }