Further performance improvements to _ecmult_wnaf

- Initialize 'wnaf' to zeroes using memset
- Add new 'len' arg to speed up smaller scalars (mostly for endo=yes)
This commit is contained in:
Peter Dettman
2015-07-12 17:50:59 +10:00
parent 145cc6ea8f
commit 55399c23f7
3 changed files with 32 additions and 21 deletions

View File

@@ -1374,7 +1374,7 @@ void test_wnaf(const secp256k1_scalar_t *number, int w) {
int bits;
secp256k1_scalar_set_int(&x, 0);
secp256k1_scalar_set_int(&two, 2);
bits = secp256k1_ecmult_wnaf(wnaf, number, w);
bits = secp256k1_ecmult_wnaf(wnaf, 256, number, w);
CHECK(bits <= 256);
for (i = bits-1; i >= 0; i--) {
int v = wnaf[i];