Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 110fa28

Browse files
committedJan 29, 2025
Affine coordinate are not correctly exposed from the underlying type.
ProjectivePoints have 3 coordinates (x,y,z) and the AffinePoint incorrectly expose just the (x, y) coordinate without converting the representation from projective to affine.
1 parent e0eff28 commit 110fa28

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎crates/starknet-types-core/src/curve/affine_point.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ impl AffinePoint {
4444

4545
/// Returns the `x` coordinate of the point.
4646
pub fn x(&self) -> Felt {
47-
Felt(*self.0.x())
47+
Felt(*self.0.to_affine().x())
4848
}
4949

5050
/// Returns the `y` coordinate of the point.
5151
pub fn y(&self) -> Felt {
52-
Felt(*self.0.y())
52+
Felt(*self.0.to_affine().y())
5353
}
5454

5555
// Returns the generator point of the StarkCurve

0 commit comments

Comments
 (0)
Please sign in to comment.