@@ -165,6 +165,14 @@ AC_ARG_WITH([ecmult-window], [AS_HELP_STRING([--with-ecmult-window=SIZE|auto],
165
165
) ] ,
166
166
[ req_ecmult_window=$withval] , [ req_ecmult_window=auto] )
167
167
168
+ AC_ARG_WITH ( [ ecmult-gen-precision] , [ AS_HELP_STRING ( [ --with-ecmult-gen-precision=2|4|8|auto] ,
169
+ [ Precision bits to tune the precomputed table size for signing.]
170
+ [ The size of the table is 32kB for 2 bits, 64kB for 4 bits, 512kB for 8 bits of precision.]
171
+ [ A smaller table size usually results in slower signing.]
172
+ [ "auto" is a reasonable setting for desktop machines (currently 4). [ default=auto] ]
173
+ ) ] ,
174
+ [ req_ecmult_gen_precision=$withval] , [ req_ecmult_gen_precision=auto] )
175
+
168
176
AC_CHECK_TYPES ( [ __int128] )
169
177
170
178
if test x"$enable_coverage" = x"yes"; then
@@ -423,6 +431,22 @@ case $set_ecmult_window in
423
431
;;
424
432
esac
425
433
434
+ # set ecmult gen precision
435
+ if test x"$req_ecmult_gen_precision" = x"auto"; then
436
+ set_ecmult_gen_precision=4
437
+ else
438
+ set_ecmult_gen_precision=$req_ecmult_gen_precision
439
+ fi
440
+
441
+ case $set_ecmult_gen_precision in
442
+ 2|4|8)
443
+ AC_DEFINE_UNQUOTED ( ECMULT_GEN_PREC_BITS , $set_ecmult_gen_precision , [ Set ecmult gen precision bits] )
444
+ ;;
445
+ *)
446
+ AC_MSG_ERROR ( [ 'ecmult gen precision not 2, 4, 8 or "auto"'] )
447
+ ;;
448
+ esac
449
+
426
450
if test x"$use_tests" = x"yes"; then
427
451
SECP_OPENSSL_CHECK
428
452
if test x"$has_openssl_ec" = x"yes"; then
@@ -558,6 +582,7 @@ echo " bignum = $set_bignum"
558
582
echo " field = $set_field"
559
583
echo " scalar = $set_scalar"
560
584
echo " ecmult window size = $set_ecmult_window"
585
+ echo " ecmult gen prec. bits = $set_ecmult_gen_precision"
561
586
echo
562
587
echo " CC = $CC"
563
588
echo " CFLAGS = $CFLAGS"
0 commit comments