parameterize ecmult_const over input size

This commit is contained in:
Andrew Poelstra
2018-03-13 16:32:51 +00:00
parent dbc3ddd5e2
commit 7c1b91ba4b
7 changed files with 78 additions and 49 deletions

View File

@@ -47,7 +47,8 @@
#else
#define WNAF_BITS 256
#endif
#define WNAF_SIZE(w) ((WNAF_BITS + (w) - 1) / (w))
#define WNAF_SIZE_BITS(bits, w) (((bits) + (w) - 1) / (w))
#define WNAF_SIZE(w) WNAF_SIZE_BITS(WNAF_BITS, w)
/** The number of entries a table with precomputed multiples needs to have. */
#define ECMULT_TABLE_SIZE(w) (1 << ((w)-2))