Skip to content

Commit

Permalink
autotools: Remove "auto" value of --with-ecmult-gen-kb option
Browse files Browse the repository at this point in the history
"auto" implies that a value is being chosen based on build system
introspection or host system capabilities. However, for the
`--with-ecmult-gen-kb` option, the value "auto" is hardcoded, which
might lead to confusion.

This change replaces "auto" with a more appropriate default value.
  • Loading branch information
hebasto committed May 27, 2024
1 parent b496b02 commit 710af8b
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,12 @@ AC_ARG_WITH([ecmult-window], [AS_HELP_STRING([--with-ecmult-window=SIZE],
)],
[set_ecmult_window=$withval], [set_ecmult_window=15])

AC_ARG_WITH([ecmult-gen-kb], [AS_HELP_STRING([--with-ecmult-gen-kb=2|22|86|auto],
AC_ARG_WITH([ecmult-gen-kb], [AS_HELP_STRING([--with-ecmult-gen-kb=2|22|86],
[The size of the precomputed table for signing in multiples of 1024 bytes (on typical platforms).]
[Larger values result in possibly better signing/keygeneration performance at the cost of a larger table.]
["auto" is a reasonable setting for desktop machines (currently 22). [default=auto]]
[The default value is a reasonable setting for desktop machines (currently 22). [default=22]]
)],
[req_ecmult_gen_kb=$withval], [req_ecmult_gen_kb=auto])
[set_ecmult_gen_kb=$withval], [set_ecmult_gen_kb=22])

AC_ARG_WITH([valgrind], [AS_HELP_STRING([--with-valgrind=yes|no|auto],
[Build with extra checks for running inside Valgrind [default=auto]]
Expand Down Expand Up @@ -350,13 +350,6 @@ case $set_ecmult_window in
;;
esac

# Set ecmult gen kb
if test x"$req_ecmult_gen_kb" = x"auto"; then
set_ecmult_gen_kb=22
else
set_ecmult_gen_kb=$req_ecmult_gen_kb
fi

case $set_ecmult_gen_kb in
2)
SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DCOMB_BLOCKS=2 -DCOMB_TEETH=5"
Expand All @@ -368,7 +361,7 @@ case $set_ecmult_gen_kb in
SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DCOMB_BLOCKS=43 -DCOMB_TEETH=6"
;;
*)
AC_MSG_ERROR(['ecmult gen table size not 2, 22, 86 or "auto"'])
AC_MSG_ERROR(['ecmult gen table size not 2, 22 or 86'])
;;
esac

Expand Down

0 comments on commit 710af8b

Please sign in to comment.