From 9de973f61376754e4125d8d2a5f1711ce421bd4b Mon Sep 17 00:00:00 2001 From: Tim Ruffing Date: Fri, 16 Feb 2024 10:58:02 +0100 Subject: [PATCH 1/3] configure: Document canonical order of modules --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index fe2cb9708..5fcce97d2 100644 --- a/configure.ac +++ b/configure.ac @@ -610,6 +610,10 @@ AC_SUBST(LIB_VERSION_AGE, _LIB_VERSION_AGE) AC_OUTPUT +# The order in which all modules are listed here should be considered the +# canonical order. This order (or, when appropriate, its reserve) should be used +# everywhere we list or process modules, i.e., here and in other build system +# files and docs. echo echo "Build Options:" echo " with external callbacks = $enable_external_default_callbacks" From 0873358f774d913c4e370d0d0218b61f92c9d171 Mon Sep 17 00:00:00 2001 From: Tim Ruffing Date: Mon, 5 Feb 2024 17:00:18 +0100 Subject: [PATCH 2/3] configure: Reorder modules also for AC_ARG_ENABLE --- configure.ac | 62 ++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/configure.ac b/configure.ac index 5fcce97d2..24c460903 100644 --- a/configure.ac +++ b/configure.ac @@ -168,24 +168,26 @@ AC_ARG_ENABLE(examples, AS_HELP_STRING([--enable-examples],[compile the examples [default=no]]), [], [SECP_SET_DEFAULT([enable_examples], [no], [yes])]) -AC_ARG_ENABLE(module_bppp, - AS_HELP_STRING([--enable-module-bppp],[enable Bulletproofs++ module (experimental)]), - [], - [SECP_SET_DEFAULT([enable_module_bppp], [no], [yes])]) - AC_ARG_ENABLE(module_ecdh, AS_HELP_STRING([--enable-module-ecdh],[enable ECDH module [default=yes]]), [], [SECP_SET_DEFAULT([enable_module_ecdh], [yes], [yes])]) -AC_ARG_ENABLE(module_musig, - AS_HELP_STRING([--enable-module-musig],[enable MuSig module (experimental)]), - [], - [SECP_SET_DEFAULT([enable_module_musig], [no], [yes])]) - AC_ARG_ENABLE(module_recovery, AS_HELP_STRING([--enable-module-recovery],[enable ECDSA pubkey recovery module [default=no]]), [], [SECP_SET_DEFAULT([enable_module_recovery], [no], [yes])]) +AC_ARG_ENABLE(module_extrakeys, + AS_HELP_STRING([--enable-module-extrakeys],[enable extrakeys module [default=yes]]), [], + [SECP_SET_DEFAULT([enable_module_extrakeys], [yes], [yes])]) + +AC_ARG_ENABLE(module_schnorrsig, + AS_HELP_STRING([--enable-module-schnorrsig],[enable schnorrsig module [default=yes]]), [], + [SECP_SET_DEFAULT([enable_module_schnorrsig], [yes], [yes])]) + +AC_ARG_ENABLE(module_ellswift, + AS_HELP_STRING([--enable-module-ellswift],[enable ElligatorSwift module [default=yes]]), [], + [SECP_SET_DEFAULT([enable_module_ellswift], [yes], [yes])]) + AC_ARG_ENABLE(module_generator, AS_HELP_STRING([--enable-module-generator],[enable NUMS generator module [default=no]]), [], @@ -196,28 +198,35 @@ AC_ARG_ENABLE(module_rangeproof, [], [SECP_SET_DEFAULT([enable_module_rangeproof], [no], [yes])]) +AC_ARG_ENABLE(module_surjectionproof, + AS_HELP_STRING([--enable-module-surjectionproof],[enable surjection proof module [default=no]]), + [], + [SECP_SET_DEFAULT([enable_module_surjectionproof], [no], [yes])]) +AC_ARG_ENABLE(reduced_surjection_proof_size, + AS_HELP_STRING([--enable-reduced-surjection-proof-size],[use reduced surjection proof size (disabling parsing and verification) [default=no]]), + [], + [SECP_SET_DEFAULT([use_reduced_surjection_proof_size], [no], [no])]) + AC_ARG_ENABLE(module_whitelist, AS_HELP_STRING([--enable-module-whitelist],[enable key whitelisting module [default=no]]), [], [SECP_SET_DEFAULT([enable_module_whitelist], [no], [yes])]) -AC_ARG_ENABLE(module_extrakeys, - AS_HELP_STRING([--enable-module-extrakeys],[enable extrakeys module [default=yes]]), [], - [SECP_SET_DEFAULT([enable_module_extrakeys], [yes], [yes])]) - -AC_ARG_ENABLE(module_schnorrsig, - AS_HELP_STRING([--enable-module-schnorrsig],[enable schnorrsig module [default=yes]]), [], - [SECP_SET_DEFAULT([enable_module_schnorrsig], [yes], [yes])]) - -AC_ARG_ENABLE(module_ellswift, - AS_HELP_STRING([--enable-module-ellswift],[enable ElligatorSwift module [default=yes]]), [], - [SECP_SET_DEFAULT([enable_module_ellswift], [yes], [yes])]) +AC_ARG_ENABLE(module_musig, + AS_HELP_STRING([--enable-module-musig],[enable MuSig module (experimental)]), + [], + [SECP_SET_DEFAULT([enable_module_musig], [no], [yes])]) AC_ARG_ENABLE(module_ecdsa_s2c, AS_HELP_STRING([--enable-module-ecdsa-s2c],[enable ECDSA sign-to-contract module [default=no]]), [], [SECP_SET_DEFAULT([enable_module_ecdsa_s2c], [no], [yes])]) +AC_ARG_ENABLE(module_bppp, + AS_HELP_STRING([--enable-module-bppp],[enable Bulletproofs++ module (experimental)]), + [], + [SECP_SET_DEFAULT([enable_module_bppp], [no], [yes])]) + AC_ARG_ENABLE(module_ecdsa-adaptor, AS_HELP_STRING([--enable-module-ecdsa-adaptor],[enable ECDSA adaptor module [default=no]]), [], @@ -227,16 +236,6 @@ AC_ARG_ENABLE(external_default_callbacks, AS_HELP_STRING([--enable-external-default-callbacks],[enable external default callback functions [default=no]]), [], [SECP_SET_DEFAULT([enable_external_default_callbacks], [no], [no])]) -AC_ARG_ENABLE(module_surjectionproof, - AS_HELP_STRING([--enable-module-surjectionproof],[enable surjection proof module [default=no]]), - [], - [SECP_SET_DEFAULT([enable_module_surjectionproof], [no], [yes])]) - -AC_ARG_ENABLE(reduced_surjection_proof_size, - AS_HELP_STRING([--enable-reduced-surjection-proof-size],[use reduced surjection proof size (disabling parsing and verification) [default=no]]), - [], - [SECP_SET_DEFAULT([use_reduced_surjection_proof_size], [no], [no])]) - # Test-only override of the (autodetected by the C code) "widemul" setting. # Legal values are: # * int64 (for [u]int64_t), @@ -627,6 +626,7 @@ echo " module recovery = $enable_module_recovery" echo " module extrakeys = $enable_module_extrakeys" echo " module schnorrsig = $enable_module_schnorrsig" echo " module ellswift = $enable_module_ellswift" +# libsecp256k1-zkp modules, in the order they were added to the libsecp256k1-zkp echo " module generator = $enable_module_generator" echo " module rangeproof = $enable_module_rangeproof" echo " module surjectionproof = $enable_module_surjectionproof" From 860e3bb29461c05b495c6f027b6c5a62532738b5 Mon Sep 17 00:00:00 2001 From: Tim Ruffing Date: Mon, 5 Feb 2024 17:01:12 +0100 Subject: [PATCH 3/3] configure: Fix reduced surjection proof size The variable set automatically by AC_ARG_ENABLE is called enable_... --- configure.ac | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 24c460903..0f9a87df0 100644 --- a/configure.ac +++ b/configure.ac @@ -205,7 +205,7 @@ AC_ARG_ENABLE(module_surjectionproof, AC_ARG_ENABLE(reduced_surjection_proof_size, AS_HELP_STRING([--enable-reduced-surjection-proof-size],[use reduced surjection proof size (disabling parsing and verification) [default=no]]), [], - [SECP_SET_DEFAULT([use_reduced_surjection_proof_size], [no], [no])]) + [SECP_SET_DEFAULT([enable_reduced_surjection_proof_size], [no], [no])]) AC_ARG_ENABLE(module_whitelist, AS_HELP_STRING([--enable-module-whitelist],[enable key whitelisting module [default=no]]), @@ -526,7 +526,7 @@ if test x"$enable_external_default_callbacks" = x"yes"; then SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" fi -if test x"$use_reduced_surjection_proof_size" = x"yes"; then +if test x"$enable_reduced_surjection_proof_size" = x"yes"; then SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DUSE_REDUCED_SURJECTION_PROOF_SIZE=1" fi @@ -630,6 +630,9 @@ echo " module ellswift = $enable_module_ellswift" echo " module generator = $enable_module_generator" echo " module rangeproof = $enable_module_rangeproof" echo " module surjectionproof = $enable_module_surjectionproof" +if test x"$enable_module_surjectionproof" = x"yes" && test x"$enable_reduced_surjection_proof_size" = x"yes"; then +echo " reduced proof size = $enable_reduced_surjection_proof_size" +fi echo " module whitelist = $enable_module_whitelist" echo " module musig = $enable_module_musig" echo " module ecdsa-s2c = $enable_module_ecdsa_s2c"