Skip to content

Commit

Permalink
Fix bug in wnaf_fixed where the wnaf array is not completely zeroed w…
Browse files Browse the repository at this point in the history
…hen given a 0 scalar.
  • Loading branch information
jonasnick committed Mar 23, 2018
1 parent 96f68a0 commit 9e36d1b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/ecmult_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -571,9 +571,8 @@ static int secp256k1_wnaf_fixed(int *wnaf, const secp256k1_scalar *s, int w) {
const secp256k1_scalar *work = s;

if (secp256k1_scalar_is_zero(s)) {
while (pos * w < WNAF_BITS) {
for (pos = 0; pos < WNAF_SIZE(w); pos++) {
wnaf[pos] = 0;
++pos;
}
return 0;
}
Expand Down

0 comments on commit 9e36d1b

Please sign in to comment.