Skip to content

Commit 9e36d1b

Browse files
committed
Fix bug in wnaf_fixed where the wnaf array is not completely zeroed when given a 0 scalar.
1 parent 96f68a0 commit 9e36d1b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/ecmult_impl.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,8 @@ static int secp256k1_wnaf_fixed(int *wnaf, const secp256k1_scalar *s, int w) {
571571
const secp256k1_scalar *work = s;
572572

573573
if (secp256k1_scalar_is_zero(s)) {
574-
while (pos * w < WNAF_BITS) {
574+
for (pos = 0; pos < WNAF_SIZE(w); pos++) {
575575
wnaf[pos] = 0;
576-
++pos;
577576
}
578577
return 0;
579578
}

0 commit comments

Comments
 (0)