Skip to content

Commit 3fbfac8

Browse files
committed
fix: disambiguate is_identity() calls between WeierstrassPoint and Group traits
Both traits define is_identity() with identical behavior (checks z == 0). Qualify ambiguous call sites as Group::is_identity() to resolve.
1 parent e133071 commit 3fbfac8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

extensions/weierstrass_ec/guest/src/ecdsa.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ where
9494
pub fn from_affine(point: AffinePoint<C>) -> Result<Self> {
9595
// Internally this calls `is_eq` on `x` and `y` coordinates, which will assert `x, y` are
9696
// reduced.
97-
if point.is_identity() {
97+
if Group::is_identity(&point) {
9898
Err(Error::new())
9999
} else {
100100
Ok(Self { point })
@@ -145,7 +145,7 @@ where
145145
}
146146

147147
pub fn to_sec1_bytes(&self, compress: bool) -> Vec<u8> {
148-
if self.point.is_identity() {
148+
if Group::is_identity(&self.point) {
149149
return vec![0x00];
150150
}
151151

@@ -533,7 +533,7 @@ where
533533
let R = <C as IntrinsicCurve>::msm(&[u1, u2], &[G, Q]);
534534
// For Coordinate<C>: IntMod, the internal implementation of is_identity will assert z
535535
// coordinate of R is reduced.
536-
if R.is_identity() {
536+
if Group::is_identity(&R) {
537537
return Err(Error::new());
538538
}
539539
let (x_1, _, _) = R.normalize().into_coords();

extensions/weierstrass_ec/guest/src/weierstrass.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ where
124124
let table = bases
125125
.iter()
126126
.map(|base| {
127-
if base.is_identity() {
127+
if Group::is_identity(base) {
128128
vec![<C::Point as Group>::IDENTITY; window_size - 2]
129129
} else {
130130
let mut multiples = Vec::with_capacity(window_size - 2);

0 commit comments

Comments
 (0)