Skip to content

Commit c82a2c8

Browse files
committed
fix while cond
1 parent b213c6d commit c82a2c8

File tree

1 file changed

+5
-5
lines changed
  • crates/math/src/elliptic_curve/short_weierstrass

1 file changed

+5
-5
lines changed

crates/math/src/elliptic_curve/short_weierstrass/point.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,17 +212,17 @@ impl<E: IsShortWeierstrass> ShortWeierstrassProjectivePoint<E> {
212212
let mut result = Self::neutral_element();
213213
let mut base = self.clone();
214214

215-
while exponent.limbs[3] != 0
216-
&& exponent.limbs[2] != 0
217-
&& exponent.limbs[1] != 0
218-
&& exponent.limbs[0] != 0
215+
while !(exponent.limbs[3] == 0
216+
&& exponent.limbs[2] == 0
217+
&& exponent.limbs[1] == 0
218+
&& exponent.limbs[0] == 0)
219219
{
220220
// check lsb
221221
if exponent.limbs[3] & 1 == 1 {
222222
result = Self::operate_with_unchecked(&result, &base);
223223
}
224224
exponent >>= 1;
225-
base = self.double();
225+
base = base.double();
226226
}
227227
result
228228
}

0 commit comments

Comments
 (0)