@@ -177,13 +177,12 @@ AC_ARG_WITH([ecmult-window], [AS_HELP_STRING([--with-ecmult-window=SIZE|auto],
177
177
) ] ,
178
178
[ req_ecmult_window=$withval] , [ req_ecmult_window=auto] )
179
179
180
- AC_ARG_WITH ( [ ecmult-gen-precision] , [ AS_HELP_STRING ( [ --with-ecmult-gen-precision=2|4|8|auto] ,
181
- [ Precision bits to tune the precomputed table size for signing.]
182
- [ The size of the table is 32kB for 2 bits, 64kB for 4 bits, 512kB for 8 bits of precision.]
183
- [ A larger table size usually results in possible faster signing.]
184
- [ "auto" is a reasonable setting for desktop machines (currently 4). [ default=auto] ]
180
+ AC_ARG_WITH ( [ ecmult-gen-kb] , [ AS_HELP_STRING ( [ --with-ecmult-gen-kb=2|22|86|auto] ,
181
+ [ The size of the precomputed table for signing in multiples of 1024 bytes (on typical platforms).]
182
+ [ Larger values result in possibly better signing/keygeneration performance at the cost of a larger table.]
183
+ [ "auto" is a reasonable setting for desktop machines (currently 86). [ default=auto] ]
185
184
) ] ,
186
- [ req_ecmult_gen_precision =$withval] , [ req_ecmult_gen_precision =auto] )
185
+ [ req_ecmult_gen_kb =$withval] , [ req_ecmult_gen_kb =auto] )
187
186
188
187
AC_ARG_WITH ( [ valgrind] , [ AS_HELP_STRING ( [ --with-valgrind=yes|no|auto] ,
189
188
[ Build with extra checks for running inside Valgrind [ default=auto] ]
@@ -307,20 +306,31 @@ case $set_ecmult_window in
307
306
esac
308
307
309
308
# Set ecmult gen precision
310
- if test x"$req_ecmult_gen_precision " = x"auto"; then
311
- set_ecmult_gen_precision=4
309
+ if test x"$req_ecmult_gen_kb " = x"auto"; then
310
+ set_ecmult_gen_kb=86
312
311
else
313
- set_ecmult_gen_precision=$req_ecmult_gen_precision
312
+ set_ecmult_gen_kb=$req_ecmult_gen_kb
314
313
fi
315
314
316
- case $set_ecmult_gen_precision in
317
- 2|4|8)
318
- AC_DEFINE_UNQUOTED ( ECMULT_GEN_PREC_BITS , $set_ecmult_gen_precision , [ Set ecmult gen precision bits] )
315
+ case $set_ecmult_gen_kb in
316
+ 2)
317
+ ecmult_gen_blocks=2
318
+ ecmult_gen_teeth=5
319
+ ;;
320
+ 22)
321
+ ecmult_gen_blocks=11
322
+ ecmult_gen_teeth=6
323
+ ;;
324
+ 86)
325
+ ecmult_gen_blocks=43
326
+ ecmult_gen_teeth=6
319
327
;;
320
328
*)
321
- AC_MSG_ERROR ( [ 'ecmult gen precision not 2, 4, 8 or "auto"'] )
329
+ AC_MSG_ERROR ( [ 'ecmult gen table size not 2, 22, 86 or "auto"'] )
322
330
;;
323
331
esac
332
+ AC_DEFINE_UNQUOTED ( COMB_BLOCKS , $ecmult_gen_blocks , [ Number of blocks for ecmult_gen computation] )
333
+ AC_DEFINE_UNQUOTED ( COMB_TEETH , $ecmult_gen_teeth , [ Number of teeth for ecmult_gen computation] )
324
334
325
335
if test x"$enable_valgrind" = x"yes"; then
326
336
SECP_INCLUDES="$SECP_INCLUDES $VALGRIND_CPPFLAGS"
@@ -424,7 +434,7 @@ echo " module schnorrsig = $enable_module_schnorrsig"
424
434
echo
425
435
echo " asm = $set_asm"
426
436
echo " ecmult window size = $set_ecmult_window"
427
- echo " ecmult gen prec. bits = $set_ecmult_gen_precision "
437
+ echo " ecmult gen kB = $set_ecmult_gen_kb "
428
438
# Hide test-only options unless they're used.
429
439
if test x"$set_widemul" != xauto; then
430
440
echo " wide multiplication = $set_widemul"
0 commit comments