Skip to content

Commit 2d465aa

Browse files
committed
Squashed 'src/secp256k1/' changes from 0b70241..53ad841
53ad841 Add explanation about how BIP32 unhardened derivation can be used to simplify whitelisting 71c5fe0 Add comment to explain effect of max_n_iterations in surjectionproof_init 85fd42f add unit test for generator and pedersen commitment roundtripping 2ccf885 rangeproof: fix serialization of pedersen commintments 60c173b rangeproof: verify correctness of pedersen commitments when parsing 32d7526 generator: verify correctness of point when parsing ae14e8a rangeproof: check that points deserialize correctly when verifying rangeproof 44fe43d rangeproof: add fixed vector test case e065d7d Expose generator in shared library fb1ba32 fix spelling in documentation fb75faa Test for rejection of trailing bytes in range proofs 9b2cf17 Test for rejection of trailing bytes in surjection proofs a3a1800 Reject surjection proofs with trailing garbage 0c77ae9 Minor bugfix. Wrong length due to NUL character. b1f31bc Add whitelisting benchmark 52a9f8f add whitelist_impl.h to include for dist a707865 generator: add API tests ec1ef04 generator: remove unnecessary ARG_CHECK from generate() b0e9aa8 Fix generator makefile 526c654 Fix pedersen_blind_generator_blind_sum return value documentation b51886e Add n_keys argument to whitelist_verify 37c57de Fix checks of whitelist serialize/parse arguments 9b8a9d9 whitelist: fix serialize/parse API to take serialized length 7f17515 Fix include/secp256k1_rangeproof.h function argument documentation. 0d81702 rangeproof: add API tests 417bb06 surjectionproof: rename unit test functions to be more consistent with other modules 1e2d5c1 surjectionproof: add API unit tests 7878a29 surjectionproof: tests_impl.h s/assert/CHECK/g e609591 rangeproof: fix memory leak in unit tests 0c17f79 add surjection proof module c174f0c Implement ring-signature based whitelist delegation scheme a2bc660 rangeproof: several API changes 21bfb3c Expose generator in pedersen/rangeproof API f4620de Constant-time generator module d46fc3c rangeproof: expose sidechannel message field in the signing API cf40b1b [RANGEPROOF BREAK] Use quadratic residue for tie break and modularity cleanup 6d28767 Get rid of precomputed H tables (Pieter Wuille) ae1e576 Pedersen commitments, borromean ring signatures, and ZK range proofs. efc61dc Add 64-bit integer utilities e34ceb3 Merge bitcoin#557: Eliminate scratch memory used when generating contexts b3bf5f9 ecmult_impl: expand comment to explain how effective affine interacts with everything efa783f Store z-ratios in the 'x' coord they'll recover ffd3b34 add `secp256k1_ge_set_all_gej_var` test which deals with many infinite points 84740ac ecmult_impl: save one fe_inv_var 4704527 ecmult_impl: eliminate scratch memory used when generating context 7f7a2ed ecmult_gen_impl: eliminate scratch memory used when generating context 314a61d Merge bitcoin#553: add static context object which has no capabilities 1086fda Merge bitcoin#354: [ECDH API change] Support custom hash function 40fde61 prevent attempts to modify `secp256k1_context_no_precomp` ed7c084 add static context object which has no capabilities 1e6f1f5 Merge bitcoin#529: fix tests.c in the count == 0 case c8fbc3c [ECDH API change] Allow pass arbitrary data to hash function b00be65 [ECDH API change] Support custom hash function 95e99f1 fix tests.c in the count == 0 case 452d8e4 Merge bitcoin#523: scratch: add stack frame support 6fe5043 scratch: add stack frame support 9bc2e26 Merge bitcoin#522: parameterize ecmult_const over input size 7c1b91b parameterize ecmult_const over input size dbc3ddd Merge bitcoin#513: Increase sparsity of pippenger fixed window naf representation fb9271d Merge bitcoin#510: add a couple missing `const`s to ecmult_pippenger_wnaf cd5f602 Merge bitcoin#515: Fix typo 09146ae Merge bitcoin#512: secp256k1_ec_privkey_negate - fix documentation ec0a7b3 Don't touch leading zeros in wnaf_fixed. 9e36d1b Fix bug in wnaf_fixed where the wnaf array is not completely zeroed when given a 0 scalar. 96f68a0 Don't invert scalar in wnaf_fixed when it is even because a caller might intentionally give a scalar with many leading zeros. 9b7c47a Fix typo 6dbb007 Increase sparsity of pippenger fixed window naf representation 1646ace secp256k1_ec_privkey_negate - fix documentation 9b3ff03 add a couple missing `const`s to ecmult_pippenger_wnaf cd329db Merge bitcoin#460: [build] Update ax_jni_include_dir.m4 macro 7f9c1a1 Merge bitcoin#498: tests: Avoid calling fclose(...) with an invalid argument f99aa8d Merge bitcoin#499: tests: Make sure we get the requested number of bytes from /dev/urandom b549d3d Merge bitcoin#472: [build] Set --enable-jni to no by default instead of auto. d333521 Merge bitcoin#494: Support OpenSSL versions >= 1.1 for ENABLE_OPENSSL_TESTS 2ef8ea5 Merge bitcoin#495: Add bench_ecmult to .gitignore 82a96e4 tests: Make sure we get the requested number of bytes from /dev/urandom 5aae5b5 Avoid calling fclose(...) with an invalid argument cb32940 Add bench_ecmult to .gitignore 31abd3a Support OpenSSL versions >= 1.1 for ENABLE_OPENSSL_TESTS c95f6f1 Merge bitcoin#487: fix tests typo, s/changed/unchanged fb46c83 Merge bitcoin#463: Reduce usage of hardcoded size constants 02f5001 Merge bitcoin#490: Disambiguate bench functions and types 1f46d60 Disambiguate bench functions and types f54c6c5 Merge bitcoin#480: Enable benchmark building by default c77fc08 Merge bitcoin#486: Add pippenger_wnaf for multi-multiplication d2f9c6b Use more precise pippenger bucket windows 4c950bb Save some additions per window in _pippenger_wnaf a58f543 Add flags for choosing algorithm in ecmult_multi benchmark 36b22c9 Use scratch space dependent batching in ecmult_multi 355a38f Add pippenger_wnaf ecmult_multi bc65aa7 Add bench_ecmult dba5471 Add ecmult_multi tests 8c1c831 Generalize Strauss to support multiple points 548de42 add resizeable scratch space API 0e96cdc fix typo, s/changed/unchanged c7680e5 Reduce usage of hardcoded size constants 6ad5cdb Merge bitcoin#479: Get rid of reserved _t in type names 7a78f60 Print whether we're building benchmarks 4afec9f Build benchmarks by default d1dc9df Get rid of reserved _t in type names 57752d2 [build] Set --enable-jni to no by default instead of auto. e7daa9b [build] Tweak JNI macro to warn instead of error for JNI not found. 5b22977 [build] Update ax_jni_include_dir.m4 macro to deal with recent versions of macOS git-subtree-dir: src/secp256k1 git-subtree-split: 53ad841cafa3bcb94b65409aec91fd7043533cf7
1 parent fd86f99 commit 2d465aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+7619
-364
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
bench_inv
22
bench_ecdh
3+
bench_ecmult
34
bench_sign
45
bench_verify
56
bench_schnorr_verify

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ cache:
1111
- src/java/guava/
1212
env:
1313
global:
14-
- FIELD=auto BIGNUM=auto SCALAR=auto ENDOMORPHISM=no STATICPRECOMPUTATION=yes ASM=no BUILD=check EXTRAFLAGS= HOST= ECDH=no RECOVERY=no EXPERIMENTAL=no
14+
- FIELD=auto BIGNUM=auto SCALAR=auto ENDOMORPHISM=no STATICPRECOMPUTATION=yes ASM=no BUILD=check EXTRAFLAGS= HOST= ECDH=no RECOVERY=no EXPERIMENTAL=no JNI=no
1515
- GUAVA_URL=https://search.maven.org/remotecontent?filepath=com/google/guava/guava/18.0/guava-18.0.jar GUAVA_JAR=src/java/guava/guava-18.0.jar
1616
matrix:
1717
- SCALAR=32bit RECOVERY=yes
@@ -29,7 +29,7 @@ env:
2929
- BUILD=distcheck
3030
- EXTRAFLAGS=CPPFLAGS=-DDETERMINISTIC
3131
- EXTRAFLAGS=CFLAGS=-O0
32-
- BUILD=check-java ECDH=yes EXPERIMENTAL=yes
32+
- BUILD=check-java JNI=yes ECDH=yes EXPERIMENTAL=yes
3333
matrix:
3434
fast_finish: true
3535
include:
@@ -65,5 +65,5 @@ before_script: ./autogen.sh
6565
script:
6666
- if [ -n "$HOST" ]; then export USE_HOST="--host=$HOST"; fi
6767
- if [ "x$HOST" = "xi686-linux-gnu" ]; then export CC="$CC -m32"; fi
68-
- ./configure --enable-experimental=$EXPERIMENTAL --enable-endomorphism=$ENDOMORPHISM --with-field=$FIELD --with-bignum=$BIGNUM --with-scalar=$SCALAR --enable-ecmult-static-precomputation=$STATICPRECOMPUTATION --enable-module-ecdh=$ECDH --enable-module-recovery=$RECOVERY $EXTRAFLAGS $USE_HOST && make -j2 $BUILD
68+
- ./configure --enable-experimental=$EXPERIMENTAL --enable-endomorphism=$ENDOMORPHISM --with-field=$FIELD --with-bignum=$BIGNUM --with-scalar=$SCALAR --enable-ecmult-static-precomputation=$STATICPRECOMPUTATION --enable-module-ecdh=$ECDH --enable-module-recovery=$RECOVERY --enable-jni=$JNI $EXTRAFLAGS $USE_HOST && make -j2 $BUILD
6969
os: linux

Makefile.am

+23-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ noinst_HEADERS += src/field_5x52_asm_impl.h
4242
noinst_HEADERS += src/java/org_bitcoin_NativeSecp256k1.h
4343
noinst_HEADERS += src/java/org_bitcoin_Secp256k1Context.h
4444
noinst_HEADERS += src/util.h
45+
noinst_HEADERS += src/scratch.h
46+
noinst_HEADERS += src/scratch_impl.h
4547
noinst_HEADERS += src/testrand.h
4648
noinst_HEADERS += src/testrand_impl.h
4749
noinst_HEADERS += src/hash.h
@@ -79,14 +81,17 @@ libsecp256k1_jni_la_CPPFLAGS = -DSECP256K1_BUILD $(JNI_INCLUDES)
7981

8082
noinst_PROGRAMS =
8183
if USE_BENCHMARK
82-
noinst_PROGRAMS += bench_verify bench_sign bench_internal
84+
noinst_PROGRAMS += bench_verify bench_sign bench_internal bench_ecmult
8385
bench_verify_SOURCES = src/bench_verify.c
8486
bench_verify_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
8587
bench_sign_SOURCES = src/bench_sign.c
8688
bench_sign_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
8789
bench_internal_SOURCES = src/bench_internal.c
8890
bench_internal_LDADD = $(SECP_LIBS) $(COMMON_LIB)
8991
bench_internal_CPPFLAGS = -DSECP256K1_BUILD $(SECP_INCLUDES)
92+
bench_ecmult_SOURCES = src/bench_ecmult.c
93+
bench_ecmult_LDADD = $(SECP_LIBS) $(COMMON_LIB)
94+
bench_ecmult_CPPFLAGS = -DSECP256K1_BUILD $(SECP_INCLUDES)
9095
endif
9196

9297
TESTS =
@@ -159,6 +164,7 @@ $(gen_context_BIN): $(gen_context_OBJECTS)
159164
$(libsecp256k1_la_OBJECTS): src/ecmult_static_context.h
160165
$(tests_OBJECTS): src/ecmult_static_context.h
161166
$(bench_internal_OBJECTS): src/ecmult_static_context.h
167+
$(bench_ecmult_OBJECTS): src/ecmult_static_context.h
162168

163169
src/ecmult_static_context.h: $(gen_context_BIN)
164170
./$(gen_context_BIN)
@@ -175,3 +181,19 @@ endif
175181
if ENABLE_MODULE_RECOVERY
176182
include src/modules/recovery/Makefile.am.include
177183
endif
184+
185+
if ENABLE_MODULE_GENERATOR
186+
include src/modules/generator/Makefile.am.include
187+
endif
188+
189+
if ENABLE_MODULE_RANGEPROOF
190+
include src/modules/rangeproof/Makefile.am.include
191+
endif
192+
193+
if ENABLE_MODULE_WHITELIST
194+
include src/modules/whitelist/Makefile.am.include
195+
endif
196+
197+
if ENABLE_MODULE_SURJECTIONPROOF
198+
include src/modules/surjection/Makefile.am.include
199+
endif

build-aux/m4/ax_jni_include_dir.m4

+26-21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ===========================================================================
2-
# http://www.gnu.org/software/autoconf-archive/ax_jni_include_dir.html
2+
# https://www.gnu.org/software/autoconf-archive/ax_jni_include_dir.html
33
# ===========================================================================
44
#
55
# SYNOPSIS
@@ -44,7 +44,7 @@
4444
# and this notice are preserved. This file is offered as-is, without any
4545
# warranty.
4646

47-
#serial 10
47+
#serial 14
4848

4949
AU_ALIAS([AC_JNI_INCLUDE_DIR], [AX_JNI_INCLUDE_DIR])
5050
AC_DEFUN([AX_JNI_INCLUDE_DIR],[
@@ -66,40 +66,45 @@ else
6666
fi
6767
6868
case "$host_os" in
69-
darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
70-
_JINC="$_JTOPDIR/Headers";;
71-
*) _JINC="$_JTOPDIR/include";;
69+
darwin*) # Apple Java headers are inside the Xcode bundle.
70+
macos_version=$(sw_vers -productVersion | sed -n -e 's/^@<:@0-9@:>@*.\(@<:@0-9@:>@*\).@<:@0-9@:>@*/\1/p')
71+
if @<:@ "$macos_version" -gt "7" @:>@; then
72+
_JTOPDIR="$(xcrun --show-sdk-path)/System/Library/Frameworks/JavaVM.framework"
73+
_JINC="$_JTOPDIR/Headers"
74+
else
75+
_JTOPDIR="/System/Library/Frameworks/JavaVM.framework"
76+
_JINC="$_JTOPDIR/Headers"
77+
fi
78+
;;
79+
*) _JINC="$_JTOPDIR/include";;
7280
esac
7381
_AS_ECHO_LOG([_JTOPDIR=$_JTOPDIR])
7482
_AS_ECHO_LOG([_JINC=$_JINC])
7583
7684
# On Mac OS X 10.6.4, jni.h is a symlink:
7785
# /System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/jni.h
7886
# -> ../../CurrentJDK/Headers/jni.h.
79-
8087
AC_CACHE_CHECK(jni headers, ac_cv_jni_header_path,
8188
[
82-
if test -f "$_JINC/jni.h"; then
83-
ac_cv_jni_header_path="$_JINC"
84-
JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $ac_cv_jni_header_path"
85-
else
86-
_JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
87-
if test -f "$_JTOPDIR/include/jni.h"; then
88-
ac_cv_jni_header_path="$_JTOPDIR/include"
89+
if test -f "$_JINC/jni.h"; then
90+
ac_cv_jni_header_path="$_JINC"
8991
JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $ac_cv_jni_header_path"
9092
else
91-
ac_cv_jni_header_path=none
93+
_JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
94+
if test -f "$_JTOPDIR/include/jni.h"; then
95+
ac_cv_jni_header_path="$_JTOPDIR/include"
96+
JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $ac_cv_jni_header_path"
97+
else
98+
ac_cv_jni_header_path=none
99+
fi
92100
fi
93-
fi
94101
])
95102
96-
97-
98103
# get the likely subdirectories for system specific java includes
99104
case "$host_os" in
100105
bsdi*) _JNI_INC_SUBDIRS="bsdos";;
101-
darwin*) _JNI_INC_SUBDIRS="darwin";;
102106
freebsd*) _JNI_INC_SUBDIRS="freebsd";;
107+
darwin*) _JNI_INC_SUBDIRS="darwin";;
103108
linux*) _JNI_INC_SUBDIRS="linux genunix";;
104109
osf*) _JNI_INC_SUBDIRS="alpha";;
105110
solaris*) _JNI_INC_SUBDIRS="solaris";;
@@ -112,9 +117,9 @@ if test "x$ac_cv_jni_header_path" != "xnone"; then
112117
# add any subdirectories that are present
113118
for JINCSUBDIR in $_JNI_INC_SUBDIRS
114119
do
115-
if test -d "$_JTOPDIR/include/$JINCSUBDIR"; then
116-
JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JTOPDIR/include/$JINCSUBDIR"
117-
fi
120+
if test -d "$_JTOPDIR/include/$JINCSUBDIR"; then
121+
JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JTOPDIR/include/$JINCSUBDIR"
122+
fi
118123
done
119124
fi
120125
])

build-aux/m4/bitcoin_secp.m4

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ if test x"$has_libcrypto" = x"yes" && test x"$has_openssl_ec" = x; then
4848
EC_KEY_free(eckey);
4949
ECDSA_SIG *sig_openssl;
5050
sig_openssl = ECDSA_SIG_new();
51-
(void)sig_openssl->r;
5251
ECDSA_SIG_free(sig_openssl);
5352
]])],[has_openssl_ec=yes],[has_openssl_ec=no])
5453
AC_MSG_RESULT([$has_openssl_ec])

configure.ac

+88-4
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])],
8585
])
8686

8787
AC_ARG_ENABLE(benchmark,
88-
AS_HELP_STRING([--enable-benchmark],[compile benchmark (default is no)]),
88+
AS_HELP_STRING([--enable-benchmark],[compile benchmark (default is yes)]),
8989
[use_benchmark=$enableval],
90-
[use_benchmark=no])
90+
[use_benchmark=yes])
9191

9292
AC_ARG_ENABLE(coverage,
9393
AS_HELP_STRING([--enable-coverage],[enable compiler flags to support kcov coverage analysis]),
@@ -134,10 +134,30 @@ AC_ARG_ENABLE(module_recovery,
134134
[enable_module_recovery=$enableval],
135135
[enable_module_recovery=no])
136136

137+
AC_ARG_ENABLE(module_generator,
138+
AS_HELP_STRING([--enable-module-generator],[enable NUMS generator module (default is no)]),
139+
[enable_module_generator=$enableval],
140+
[enable_module_generator=no])
141+
142+
AC_ARG_ENABLE(module_rangeproof,
143+
AS_HELP_STRING([--enable-module-rangeproof],[enable Pedersen / zero-knowledge range proofs module (default is no)]),
144+
[enable_module_rangeproof=$enableval],
145+
[enable_module_rangeproof=no])
146+
147+
AC_ARG_ENABLE(module_whitelist,
148+
AS_HELP_STRING([--enable-module-whitelist],[enable key whitelisting module (default is no)]),
149+
[enable_module_whitelist=$enableval],
150+
[enable_module_whitelist=no])
151+
137152
AC_ARG_ENABLE(jni,
138-
AS_HELP_STRING([--enable-jni],[enable libsecp256k1_jni (default is auto)]),
153+
AS_HELP_STRING([--enable-jni],[enable libsecp256k1_jni (default is no)]),
139154
[use_jni=$enableval],
140-
[use_jni=auto])
155+
[use_jni=no])
156+
157+
AC_ARG_ENABLE(module_surjectionproof,
158+
AS_HELP_STRING([--enable-module-surjectionproof],[enable surjection proof module (default is no)]),
159+
[enable_module_surjectionproof=$enableval],
160+
[enable_module_surjectionproof=no])
141161

142162
AC_ARG_WITH([field], [AS_HELP_STRING([--with-field=64bit|32bit|auto],
143163
[Specify Field Implementation. Default is auto])],[req_field=$withval], [req_field=auto])
@@ -167,6 +187,12 @@ else
167187
CFLAGS="$CFLAGS -O3"
168188
fi
169189

190+
AC_MSG_CHECKING([for __builtin_popcount])
191+
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[void myfunc() {__builtin_popcount(0);}]])],
192+
[ AC_MSG_RESULT([yes]);AC_DEFINE(HAVE_BUILTIN_POPCOUNT,1,[Define this symbol if __builtin_popcount is available]) ],
193+
[ AC_MSG_RESULT([no])
194+
])
195+
170196
if test x"$use_ecmult_static_precomputation" != x"no"; then
171197
save_cross_compiling=$cross_compiling
172198
cross_compiling=no
@@ -195,6 +221,12 @@ else
195221
set_precomp=no
196222
fi
197223

224+
AC_MSG_CHECKING([for __builtin_clzll])
225+
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[void myfunc() { __builtin_clzll(1);}]])],
226+
[ AC_MSG_RESULT([yes]);AC_DEFINE(HAVE_BUILTIN_CLZLL,1,[Define this symbol if __builtin_clzll is available]) ],
227+
[ AC_MSG_RESULT([no])
228+
])
229+
198230
if test x"$req_asm" = x"auto"; then
199231
SECP_64BIT_ASM_CHECK
200232
if test x"$has_64bit_asm" = x"yes"; then
@@ -435,6 +467,22 @@ if test x"$enable_module_recovery" = x"yes"; then
435467
AC_DEFINE(ENABLE_MODULE_RECOVERY, 1, [Define this symbol to enable the ECDSA pubkey recovery module])
436468
fi
437469

470+
if test x"$enable_module_generator" = x"yes"; then
471+
AC_DEFINE(ENABLE_MODULE_GENERATOR, 1, [Define this symbol to enable the NUMS generator module])
472+
fi
473+
474+
if test x"$enable_module_rangeproof" = x"yes"; then
475+
AC_DEFINE(ENABLE_MODULE_RANGEPROOF, 1, [Define this symbol to enable the Pedersen / zero knowledge range proof module])
476+
fi
477+
478+
if test x"$enable_module_whitelist" = x"yes"; then
479+
AC_DEFINE(ENABLE_MODULE_WHITELIST, 1, [Define this symbol to enable the key whitelisting module])
480+
fi
481+
482+
if test x"$enable_module_surjectionproof" = x"yes"; then
483+
AC_DEFINE(ENABLE_MODULE_SURJECTIONPROOF, 1, [Define this symbol to enable the surjection proof module])
484+
fi
485+
438486
AC_C_BIGENDIAN()
439487

440488
if test x"$use_external_asm" = x"yes"; then
@@ -447,6 +495,7 @@ AC_MSG_NOTICE([Using field implementation: $set_field])
447495
AC_MSG_NOTICE([Using bignum implementation: $set_bignum])
448496
AC_MSG_NOTICE([Using scalar implementation: $set_scalar])
449497
AC_MSG_NOTICE([Using endomorphism optimizations: $use_endomorphism])
498+
AC_MSG_NOTICE([Building benchmarks: $use_benchmark])
450499
AC_MSG_NOTICE([Building for coverage analysis: $enable_coverage])
451500
AC_MSG_NOTICE([Building ECDH module: $enable_module_ecdh])
452501
AC_MSG_NOTICE([Building ECDSA pubkey recovery module: $enable_module_recovery])
@@ -457,14 +506,45 @@ if test x"$enable_experimental" = x"yes"; then
457506
AC_MSG_NOTICE([WARNING: experimental build])
458507
AC_MSG_NOTICE([Experimental features do not have stable APIs or properties, and may not be safe for production use.])
459508
AC_MSG_NOTICE([Building ECDH module: $enable_module_ecdh])
509+
AC_MSG_NOTICE([Building NUMS generator module: $enable_module_generator])
510+
AC_MSG_NOTICE([Building range proof module: $enable_module_rangeproof])
511+
AC_MSG_NOTICE([Building key whitelisting module: $enable_module_whitelist])
512+
AC_MSG_NOTICE([Building surjection proof module: $enable_module_surjectionproof])
460513
AC_MSG_NOTICE([******])
514+
515+
if test x"$enable_module_generator" != x"yes"; then
516+
if test x"$enable_module_rangeproof" = x"yes"; then
517+
AC_MSG_ERROR([Rangeproof module requires the generator module. Use --enable-module-generator to allow.])
518+
fi
519+
fi
520+
521+
if test x"$enable_module_rangeproof" != x"yes"; then
522+
if test x"$enable_module_whitelist" = x"yes"; then
523+
AC_MSG_ERROR([Whitelist module requires the rangeproof module. Use --enable-module-rangeproof to allow.])
524+
fi
525+
if test x"$enable_module_surjectionproof" = x"yes"; then
526+
AC_MSG_ERROR([Surjection proof module requires the rangeproof module. Use --enable-module-rangeproof to allow.])
527+
fi
528+
fi
461529
else
462530
if test x"$enable_module_ecdh" = x"yes"; then
463531
AC_MSG_ERROR([ECDH module is experimental. Use --enable-experimental to allow.])
464532
fi
465533
if test x"$set_asm" = x"arm"; then
466534
AC_MSG_ERROR([ARM assembly optimization is experimental. Use --enable-experimental to allow.])
467535
fi
536+
if test x"$enable_module_generator" = x"yes"; then
537+
AC_MSG_ERROR([NUMS generator module is experimental. Use --enable-experimental to allow.])
538+
fi
539+
if test x"$enable_module_rangeproof" = x"yes"; then
540+
AC_MSG_ERROR([Range proof module is experimental. Use --enable-experimental to allow.])
541+
fi
542+
if test x"$enable_module_whitelist" = x"yes"; then
543+
AC_MSG_ERROR([Key whitelisting module is experimental. Use --enable-experimental to allow.])
544+
fi
545+
if test x"$enable_module_surjectionproof" = x"yes"; then
546+
AC_MSG_ERROR([Surjection proof module is experimental. Use --enable-experimental to allow.])
547+
fi
468548
fi
469549

470550
AC_CONFIG_HEADERS([src/libsecp256k1-config.h])
@@ -481,9 +561,13 @@ AM_CONDITIONAL([USE_BENCHMARK], [test x"$use_benchmark" = x"yes"])
481561
AM_CONDITIONAL([USE_ECMULT_STATIC_PRECOMPUTATION], [test x"$set_precomp" = x"yes"])
482562
AM_CONDITIONAL([ENABLE_MODULE_ECDH], [test x"$enable_module_ecdh" = x"yes"])
483563
AM_CONDITIONAL([ENABLE_MODULE_RECOVERY], [test x"$enable_module_recovery" = x"yes"])
564+
AM_CONDITIONAL([ENABLE_MODULE_GENERATOR], [test x"$enable_module_generator" = x"yes"])
565+
AM_CONDITIONAL([ENABLE_MODULE_RANGEPROOF], [test x"$enable_module_rangeproof" = x"yes"])
566+
AM_CONDITIONAL([ENABLE_MODULE_WHITELIST], [test x"$enable_module_whitelist" = x"yes"])
484567
AM_CONDITIONAL([USE_JNI], [test x"$use_jni" == x"yes"])
485568
AM_CONDITIONAL([USE_EXTERNAL_ASM], [test x"$use_external_asm" = x"yes"])
486569
AM_CONDITIONAL([USE_ASM_ARM], [test x"$set_asm" = x"arm"])
570+
AM_CONDITIONAL([ENABLE_MODULE_SURJECTIONPROOF], [test x"$enable_module_surjectionproof" = x"yes"])
487571

488572
dnl make sure nothing new is exported so that we don't break the cache
489573
PKGCONFIG_PATH_TEMP="$PKG_CONFIG_PATH"

0 commit comments

Comments
 (0)