Fix bug in wnaf_fixed where the wnaf array is not completely zeroed when given a 0 scalar.

This commit is contained in:
Jonas Nick 2018-03-23 13:57:16 +00:00
parent 96f68a0afc
commit 9e36d1bfe2
1 changed files with 1 additions and 2 deletions

View File

@ -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;
}