Increase sparsity of pippenger fixed window naf representation

This commit is contained in:
Jonas Nick
2018-02-27 21:34:08 +00:00
parent cd329dbc3e
commit 6dbb007869
2 changed files with 14 additions and 2 deletions

View File

@@ -3022,8 +3022,7 @@ void test_fixed_wnaf(const secp256k1_scalar *number, int w) {
for (i = WNAF_SIZE(w)-1; i >= 0; --i) {
secp256k1_scalar t;
int v = wnaf[i];
CHECK(v != 0); /* check nonzero */
CHECK(v & 1); /* check parity */
CHECK(v == 0 || v & 1); /* check parity */
CHECK(v > -(1 << w)); /* check range above */
CHECK(v < (1 << w)); /* check range below */