Skip to content

Commit

Permalink
autotools: Remove "auto" value of --with-ecmult-window 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-window` 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 06bff6d commit 122dbae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
MAKEFLAGS: -j4
BUILD: check
### secp256k1 config
ECMULTWINDOW: auto
ECMULTWINDOW: 15
ECMULTGENKB: auto
ASM: no
WIDEMUL: auto
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ env:
MAKEFLAGS: '-j4'
BUILD: 'check'
### secp256k1 config
ECMULTWINDOW: 'auto'
ECMULTWINDOW: 15
ECMULTGENKB: 'auto'
ASM: 'no'
WIDEMUL: 'auto'
Expand Down
15 changes: 4 additions & 11 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,15 @@ AC_ARG_WITH([test-override-wide-multiply], [] ,[set_widemul=$withval], [set_wide
AC_ARG_WITH([asm], [AS_HELP_STRING([--with-asm=x86_64|arm32|no|auto],
[assembly to use (experimental: arm32) [default=auto]])],[req_asm=$withval], [req_asm=auto])

AC_ARG_WITH([ecmult-window], [AS_HELP_STRING([--with-ecmult-window=SIZE|auto],
AC_ARG_WITH([ecmult-window], [AS_HELP_STRING([--with-ecmult-window=SIZE],
[window size for ecmult precomputation for verification, specified as integer in range [2..24].]
[Larger values result in possibly better performance at the cost of an exponentially larger precomputed table.]
[The table will store 2^(SIZE-1) * 64 bytes of data but can be larger in memory due to platform-specific padding and alignment.]
[A window size larger than 15 will require you delete the prebuilt precomputed_ecmult.c file so that it can be rebuilt.]
[For very large window sizes, use "make -j 1" to reduce memory use during compilation.]
["auto" is a reasonable setting for desktop machines (currently 15). [default=auto]]
[The default value is a reasonable setting for desktop machines (currently 15). [default=15]]
)],
[req_ecmult_window=$withval], [req_ecmult_window=auto])
[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],
[The size of the precomputed table for signing in multiples of 1024 bytes (on typical platforms).]
Expand Down Expand Up @@ -335,14 +335,7 @@ auto)
;;
esac

# Set ecmult window size
if test x"$req_ecmult_window" = x"auto"; then
set_ecmult_window=15
else
set_ecmult_window=$req_ecmult_window
fi

error_window_size=['window size for ecmult precomputation not an integer in range [2..24] or "auto"']
error_window_size=['window size for ecmult precomputation not an integer in range [2..24]']
case $set_ecmult_window in
''|*[[!0-9]]*)
# no valid integer
Expand Down

0 comments on commit 122dbae

Please sign in to comment.