Skip to content

Commit 5f1622f

Browse files
authored
Merge pull request #257 from apoelstra/2020-12--no-endo
update libsecp, remove endomorphism feature flag and release 0.20.0
2 parents c534b54 + c4d2fef commit 5f1622f

File tree

107 files changed

+6635
-6325
lines changed

Some content is hidden

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

107 files changed

+6635
-6325
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11

2+
# 0.20.0 - 2020-12-21
3+
4+
* [remove `ffi::PublicKey::blank`](https://github.com/rust-bitcoin/rust-secp256k1/pull/232) and replace with unsafe [`ffi::PublicKey::new` and `ffi::PublicKey::from_array_unchecked`](https://github.com/rust-bitcoin/rust-secp256k1/pull/253/); similar for all other FFI types
5+
* [support wasm32-wasi target](https://github.com/rust-bitcoin/rust-secp256k1/pull/242)
6+
* [make the global-context feature depend on the rand-std feature](https://github.com/rust-bitcoin/rust-secp256k1/pull/246)
7+
* [add a lexicographic ordering to `PublicKey`](https://github.com/rust-bitcoin/rust-secp256k1/pull/248) which does **not** match the ordering used by Bitcoin Core (matching this would be impossible as it requires tracking a compressedness flag, which libsecp256k1 does not have)
8+
* [implement BIP340 Schnorr signatures](https://github.com/rust-bitcoin/rust-secp256k1/pull/237)
9+
* [require use of new `AlignedType` in preallocated-context API to enforce alignment requirements](https://github.com/rust-bitcoin/rust-secp256k1/pull/233); previously it was possible to get UB by using misaligned memory stores
10+
* [enforce correct alignment when using preallocated context API](https://github.com/rust-bitcoin/rust-secp256k1/pull/233)
11+
* [stop using cargo features for dangerous build-breaking options, require setting `RUSTFLAGS` instead](https://github.com/rust-bitcoin/rust-secp256k1/pull/263)
12+
* [implement low-R signing and function to grind even smaller signatures](https://github.com/rust-bitcoin/rust-secp256k1/pull/259)
13+
* [remove endomorphism feature, following upstream in enabling it by default](https://github.com/rust-bitcoin/rust-secp256k1/pull/257)
14+
215
# 0.19.0 - 2020-08-27
316

417
* **Update MSRV to 1.29.0**

Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "secp256k1"
3-
version = "0.19.0"
3+
version = "0.20.0"
44
authors = [ "Dawid Ciężarkiewicz <[email protected]>",
55
"Andrew Poelstra <[email protected]>" ]
66
license = "CC0-1.0"
@@ -14,20 +14,19 @@ autoexamples = false # Remove when edition 2018 https://github.com/rust-lang/car
1414

1515
# Should make docs.rs show all functions, even those behind non-default features
1616
[package.metadata.docs.rs]
17-
features = [ "rand", "rand-std", "serde", "recovery", "endomorphism" ]
17+
features = [ "rand", "rand-std", "serde", "recovery" ]
1818

1919
[features]
2020
unstable = ["recovery", "rand-std"]
2121
default = ["std"]
2222
std = ["secp256k1-sys/std"]
2323
rand-std = ["rand/std"]
2424
recovery = ["secp256k1-sys/recovery"]
25-
endomorphism = ["secp256k1-sys/endomorphism"]
2625
lowmemory = ["secp256k1-sys/lowmemory"]
2726
global-context = ["std", "rand-std"]
2827

2928
[dependencies]
30-
secp256k1-sys = { version = "0.3.1", default-features = false, path = "./secp256k1-sys" }
29+
secp256k1-sys = { version = "0.4.0", default-features = false, path = "./secp256k1-sys" }
3130
bitcoin_hashes = { version = "0.9", optional = true }
3231
rand = { version = "0.6", default-features = false, optional = true }
3332
serde = { version = "1.0", default-features = false, optional = true }

contrib/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh -ex
22

3-
FEATURES="bitcoin_hashes endomorphism global-context lowmemory rand rand-std recovery serde"
3+
FEATURES="bitcoin_hashes global-context lowmemory rand rand-std recovery serde"
44

55
# Use toolchain if explicitly specified
66
if [ -n "$TOOLCHAIN" ]

no_std_test/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl RngCore for FakeRng {
8383

8484
#[start]
8585
fn start(_argc: isize, _argv: *const *const u8) -> isize {
86-
let mut buf = [AlignedType::zeroed(); 37_000];
86+
let mut buf = [AlignedType::zeroed(); 70_000];
8787
let size = Secp256k1::preallocate_size();
8888
unsafe { libc::printf("needed size: %d\n\0".as_ptr() as _, size) };
8989

secp256k1-sys/Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "secp256k1-sys"
3-
version = "0.3.1"
3+
version = "0.4.0"
44
authors = [ "Dawid Ciężarkiewicz <[email protected]>",
55
"Andrew Poelstra <[email protected]>",
66
"Steven Roose <[email protected]>" ]
@@ -12,11 +12,11 @@ description = "FFI for Pieter Wuille's `libsecp256k1` library."
1212
keywords = [ "secp256k1", "libsecp256k1", "ffi" ]
1313
readme = "README.md"
1414
build = "build.rs"
15-
links = "rustsecp256k1_v0_3_1"
15+
links = "rustsecp256k1_v0_4_0"
1616

1717
# Should make docs.rs show all functions, even those behind non-default features
1818
[package.metadata.docs.rs]
19-
features = [ "recovery", "endomorphism", "lowmemory" ]
19+
features = [ "recovery", "lowmemory" ]
2020

2121
[build-dependencies]
2222
cc = "1.0.28"
@@ -27,7 +27,6 @@ libc = "0.2"
2727
[features]
2828
default = ["std"]
2929
recovery = []
30-
endomorphism = []
3130
lowmemory = []
3231
std = []
3332

secp256k1-sys/build.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,9 @@ fn main() {
4848
base_config.define("ECMULT_WINDOW_SIZE", Some("15")); // This is the default in the configure file (`auto`)
4949
}
5050
base_config.define("USE_EXTERNAL_DEFAULT_CALLBACKS", Some("1"));
51-
#[cfg(feature = "endomorphism")]
52-
base_config.define("USE_ENDOMORPHISM", Some("1"));
5351
#[cfg(feature = "recovery")]
5452
base_config.define("ENABLE_MODULE_RECOVERY", Some("1"));
5553

56-
if let Ok(target_endian) = env::var("CARGO_CFG_TARGET_ENDIAN") {
57-
if target_endian == "big" {
58-
base_config.define("WORDS_BIGENDIAN", Some("1"));
59-
}
60-
}
61-
6254
match &env::var("TARGET").unwrap() as &str {
6355
"wasm32-unknown-unknown"|"wasm32-wasi" =>
6456
{ base_config.include("wasm-sysroot"); },

secp256k1-sys/depend/scratch_impl.h.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
< static void secp256k1_scratch_destroy(const secp256k1_callback* error_callback, secp256k1_scratch* scratch) {
1616
< if (scratch != NULL) {
1717
< VERIFY_CHECK(scratch->alloc_size == 0); /* all checkpoints should be applied */
18-
< if (memcmp(scratch->magic, "scratch", 8) != 0) {
18+
< if (secp256k1_memcmp_var(scratch->magic, "scratch", 8) != 0) {
1919
< secp256k1_callback_call(error_callback, "invalid scratch space");
2020
< return;
2121
< }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# This file was automatically created by ./vendor-libsecp.sh
2-
63150ab4da1ef13ebfb4396064e1ff501dbd015e
2+
98dac87839838b86094f1bccc71cc20e67b146cc

secp256k1-sys/depend/secp256k1/.travis.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,30 @@ compiler:
1717
- gcc
1818
env:
1919
global:
20-
- WIDEMUL=auto BIGNUM=auto ENDOMORPHISM=no STATICPRECOMPUTATION=yes ECMULTGENPRECISION=auto ASM=no BUILD=check WITH_VALGRIND=yes RUN_VALGRIND=no EXTRAFLAGS= HOST= ECDH=no RECOVERY=no SCHNORRSIG=no EXPERIMENTAL=no CTIMETEST=yes BENCH=yes ITERS=2
20+
- WIDEMUL=auto BIGNUM=auto STATICPRECOMPUTATION=yes ECMULTGENPRECISION=auto ASM=no BUILD=check WITH_VALGRIND=yes RUN_VALGRIND=no EXTRAFLAGS= HOST= ECDH=no RECOVERY=no SCHNORRSIG=no EXPERIMENTAL=no CTIMETEST=yes BENCH=yes ITERS=2
2121
matrix:
2222
- WIDEMUL=int64 RECOVERY=yes
2323
- WIDEMUL=int64 ECDH=yes EXPERIMENTAL=yes SCHNORRSIG=yes
24-
- WIDEMUL=int64 ENDOMORPHISM=yes
2524
- WIDEMUL=int128
2625
- WIDEMUL=int128 RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes
27-
- WIDEMUL=int128 ENDOMORPHISM=yes
28-
- WIDEMUL=int128 ENDOMORPHISM=yes ECDH=yes EXPERIMENTAL=yes SCHNORRSIG=yes
26+
- WIDEMUL=int128 ECDH=yes EXPERIMENTAL=yes SCHNORRSIG=yes
2927
- WIDEMUL=int128 ASM=x86_64
30-
- WIDEMUL=int128 ENDOMORPHISM=yes ASM=x86_64
3128
- BIGNUM=no
32-
- BIGNUM=no ENDOMORPHISM=yes RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes
29+
- BIGNUM=no RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes
3330
- BIGNUM=no STATICPRECOMPUTATION=no
3431
- BUILD=distcheck WITH_VALGRIND=no CTIMETEST=no BENCH=no
3532
- CPPFLAGS=-DDETERMINISTIC
3633
- CFLAGS=-O0 CTIMETEST=no
34+
- CFLAGS="-fsanitize=undefined -fno-omit-frame-pointer" LDFLAGS="-fsanitize=undefined -fno-omit-frame-pointer" UBSAN_OPTIONS="print_stacktrace=1:halt_on_error=1" BIGNUM=no ASM=x86_64 ECDH=yes RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes CTIMETEST=no
3735
- ECMULTGENPRECISION=2
3836
- ECMULTGENPRECISION=8
39-
- RUN_VALGRIND=yes ENDOMORPHISM=yes BIGNUM=no ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes EXTRAFLAGS="--disable-openssl-tests" BUILD=
40-
- RUN_VALGRIND=yes BIGNUM=no ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes EXTRAFLAGS="--disable-openssl-tests" BUILD=
37+
- RUN_VALGRIND=yes BIGNUM=no ASM=x86_64 ECDH=yes RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes EXTRAFLAGS="--disable-openssl-tests" BUILD=
4138
matrix:
4239
fast_finish: true
4340
include:
4441
- compiler: clang
4542
os: linux
46-
env: HOST=i686-linux-gnu ENDOMORPHISM=yes
43+
env: HOST=i686-linux-gnu
4744
addons:
4845
apt:
4946
packages:
@@ -63,7 +60,7 @@ matrix:
6360
- libtool-bin
6461
- libc6-dbg:i386
6562
- compiler: gcc
66-
env: HOST=i686-linux-gnu ENDOMORPHISM=yes
63+
env: HOST=i686-linux-gnu
6764
os: linux
6865
addons:
6966
apt:
@@ -85,7 +82,7 @@ matrix:
8582
- libc6-dbg:i386
8683
# S390x build (big endian system)
8784
- compiler: gcc
88-
env: HOST=s390x-unknown-linux-gnu ECDH=yes RECOVERY=yes EXPERIMENTAL=yes CTIMETEST=
85+
env: HOST=s390x-unknown-linux-gnu ECDH=yes RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes CTIMETEST=
8986
arch: s390x
9087

9188
# We use this to install macOS dependencies instead of the built in `homebrew` plugin,

secp256k1-sys/depend/secp256k1/Makefile.am

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ACLOCAL_AMFLAGS = -I build-aux/m4
22

33
lib_LTLIBRARIES = libsecp256k1.la
44
include_HEADERS = include/secp256k1.h
5-
include_HEADERS += include/rustsecp256k1_v0_3_1_preallocated.h
5+
include_HEADERS += include/rustsecp256k1_v0_4_0_preallocated.h
66
noinst_HEADERS =
77
noinst_HEADERS += src/scalar.h
88
noinst_HEADERS += src/scalar_4x64.h
@@ -52,7 +52,7 @@ noinst_HEADERS += contrib/lax_der_privatekey_parsing.h
5252
noinst_HEADERS += contrib/lax_der_privatekey_parsing.c
5353

5454
if USE_EXTERNAL_ASM
55-
COMMON_LIB = librustsecp256k1_v0_3_1_common.la
55+
COMMON_LIB = librustsecp256k1_v0_4_0_common.la
5656
noinst_LTLIBRARIES = $(COMMON_LIB)
5757
else
5858
COMMON_LIB =
@@ -63,16 +63,16 @@ pkgconfig_DATA = libsecp256k1.pc
6363

6464
if USE_EXTERNAL_ASM
6565
if USE_ASM_ARM
66-
librustsecp256k1_v0_3_1_common_la_SOURCES = src/asm/field_10x26_arm.s
66+
librustsecp256k1_v0_4_0_common_la_SOURCES = src/asm/field_10x26_arm.s
6767
endif
6868
endif
6969

70-
librustsecp256k1_v0_3_1_la_SOURCES = src/secp256k1.c
71-
librustsecp256k1_v0_3_1_la_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/include -I$(top_srcdir)/src $(SECP_INCLUDES)
72-
librustsecp256k1_v0_3_1_la_LIBADD = $(SECP_LIBS) $(COMMON_LIB)
70+
librustsecp256k1_v0_4_0_la_SOURCES = src/secp256k1.c
71+
librustsecp256k1_v0_4_0_la_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/include -I$(top_srcdir)/src $(SECP_INCLUDES)
72+
librustsecp256k1_v0_4_0_la_LIBADD = $(SECP_LIBS) $(COMMON_LIB)
7373

7474
if VALGRIND_ENABLED
75-
librustsecp256k1_v0_3_1_la_CPPFLAGS += -DVALGRIND
75+
librustsecp256k1_v0_4_0_la_CPPFLAGS += -DVALGRIND
7676
endif
7777

7878
noinst_PROGRAMS =
@@ -134,7 +134,7 @@ gen_%.o: src/gen_%.c src/libsecp256k1-config.h
134134
$(gen_context_BIN): $(gen_context_OBJECTS)
135135
$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $^ -o $@
136136

137-
$(librustsecp256k1_v0_3_1_la_OBJECTS): src/ecmult_static_context.h
137+
$(librustsecp256k1_v0_4_0_la_OBJECTS): src/ecmult_static_context.h
138138
$(tests_OBJECTS): src/ecmult_static_context.h
139139
$(bench_internal_OBJECTS): src/ecmult_static_context.h
140140
$(bench_ecmult_OBJECTS): src/ecmult_static_context.h

secp256k1-sys/depend/secp256k1/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Features:
1616
* Very efficient implementation.
1717
* Suitable for embedded systems.
1818
* Optional module for public key recovery.
19-
* Optional module for ECDH key exchange (experimental).
19+
* Optional module for ECDH key exchange.
2020

2121
Experimental features have not received enough scrutiny to satisfy the standard of quality of this library but are made available for testing and review by the community. The APIs of these features should not be considered stable.
2222

@@ -48,7 +48,7 @@ Implementation details
4848
* Use wNAF notation for point multiplicands.
4949
* Use a much larger window for multiples of G, using precomputed multiples.
5050
* Use Shamir's trick to do the multiplication with the public key and the generator simultaneously.
51-
* Optionally (off by default) use secp256k1's efficiently-computable endomorphism to split the P multiplicand into 2 half-sized ones.
51+
* Use secp256k1's efficiently-computable endomorphism to split the P multiplicand into 2 half-sized ones.
5252
* Point multiplication for signing
5353
* Use a precomputed table of multiples of powers of 16 multiplied with the generator, so general multiplication becomes a series of additions.
5454
* Intended to be completely free of timing sidechannels for secret-key operations (on reasonable hardware/toolchains)

secp256k1-sys/depend/secp256k1/build-aux/m4/ax_prog_cc_for_build.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ===========================================================================
2-
# http://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html
2+
# https://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html
33
# ===========================================================================
44
#
55
# SYNOPSIS

secp256k1-sys/depend/secp256k1/build-aux/m4/bitcoin_secp.m4

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,39 @@ if test x"$has_libcrypto" = x"yes" && test x"$has_openssl_ec" = x; then
3636
CPPFLAGS_TEMP="$CPPFLAGS"
3737
CPPFLAGS="$CRYPTO_CPPFLAGS $CPPFLAGS"
3838
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
39+
#include <openssl/bn.h>
3940
#include <openssl/ec.h>
4041
#include <openssl/ecdsa.h>
4142
#include <openssl/obj_mac.h>]],[[
42-
EC_KEY *eckey = EC_KEY_new_by_curve_name(NID_secp256k1);
43-
ECDSA_sign(0, NULL, 0, NULL, NULL, eckey);
43+
# if OPENSSL_VERSION_NUMBER < 0x10100000L
44+
void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps) {(void)sig->r; (void)sig->s;}
45+
# endif
46+
47+
unsigned int zero = 0;
48+
const unsigned char *zero_ptr = (unsigned char*)&zero;
49+
EC_KEY_free(EC_KEY_new_by_curve_name(NID_secp256k1));
50+
EC_KEY *eckey = EC_KEY_new();
51+
EC_GROUP *group = EC_GROUP_new_by_curve_name(NID_secp256k1);
52+
EC_KEY_set_group(eckey, group);
53+
ECDSA_sign(0, NULL, 0, NULL, &zero, eckey);
4454
ECDSA_verify(0, NULL, 0, NULL, 0, eckey);
55+
o2i_ECPublicKey(&eckey, &zero_ptr, 0);
56+
d2i_ECPrivateKey(&eckey, &zero_ptr, 0);
57+
EC_KEY_check_key(eckey);
4558
EC_KEY_free(eckey);
59+
EC_GROUP_free(group);
4660
ECDSA_SIG *sig_openssl;
4761
sig_openssl = ECDSA_SIG_new();
62+
d2i_ECDSA_SIG(&sig_openssl, &zero_ptr, 0);
63+
i2d_ECDSA_SIG(sig_openssl, NULL);
64+
ECDSA_SIG_get0(sig_openssl, NULL, NULL);
4865
ECDSA_SIG_free(sig_openssl);
66+
const BIGNUM *bignum = BN_value_one();
67+
BN_is_negative(bignum);
68+
BN_num_bits(bignum);
69+
if (sizeof(zero) >= BN_num_bytes(bignum)) {
70+
BN_bn2bin(bignum, (unsigned char*)&zero);
71+
}
4972
]])],[has_openssl_ec=yes],[has_openssl_ec=no])
5073
AC_MSG_RESULT([$has_openssl_ec])
5174
CPPFLAGS="$CPPFLAGS_TEMP"

secp256k1-sys/depend/secp256k1/configure.ac

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -116,18 +116,13 @@ AC_ARG_ENABLE(exhaustive_tests,
116116
[use_exhaustive_tests=$enableval],
117117
[use_exhaustive_tests=yes])
118118

119-
AC_ARG_ENABLE(endomorphism,
120-
AS_HELP_STRING([--enable-endomorphism],[enable endomorphism [default=no]]),
121-
[use_endomorphism=$enableval],
122-
[use_endomorphism=no])
123-
124119
AC_ARG_ENABLE(ecmult_static_precomputation,
125120
AS_HELP_STRING([--enable-ecmult-static-precomputation],[enable precomputed ecmult table for signing [default=auto]]),
126121
[use_ecmult_static_precomputation=$enableval],
127122
[use_ecmult_static_precomputation=auto])
128123

129124
AC_ARG_ENABLE(module_ecdh,
130-
AS_HELP_STRING([--enable-module-ecdh],[enable ECDH shared secret computation (experimental)]),
125+
AS_HELP_STRING([--enable-module-ecdh],[enable ECDH shared secret computation]),
131126
[enable_module_ecdh=$enableval],
132127
[enable_module_ecdh=no])
133128

@@ -164,8 +159,7 @@ AC_ARG_WITH([asm], [AS_HELP_STRING([--with-asm=x86_64|arm|no|auto],
164159
AC_ARG_WITH([ecmult-window], [AS_HELP_STRING([--with-ecmult-window=SIZE|auto],
165160
[window size for ecmult precomputation for verification, specified as integer in range [2..24].]
166161
[Larger values result in possibly better performance at the cost of an exponentially larger precomputed table.]
167-
[The table will store 2^(SIZE-2) * 64 bytes of data but can be larger in memory due to platform-specific padding and alignment.]
168-
[If the endomorphism optimization is enabled, two tables of this size are used instead of only one.]
162+
[The table will store 2^(SIZE-1) * 64 bytes of data but can be larger in memory due to platform-specific padding and alignment.]
169163
["auto" is a reasonable setting for desktop machines (currently 15). [default=auto]]
170164
)],
171165
[req_ecmult_window=$withval], [req_ecmult_window=auto])
@@ -401,8 +395,8 @@ esac
401395

402396
if test x"$use_tests" = x"yes"; then
403397
SECP_OPENSSL_CHECK
404-
if test x"$has_openssl_ec" = x"yes"; then
405-
if test x"$enable_openssl_tests" != x"no"; then
398+
if test x"$enable_openssl_tests" != x"no" && test x"$has_openssl_ec" = x"yes"; then
399+
enable_openssl_tests=yes
406400
AC_DEFINE(ENABLE_OPENSSL_TESTS, 1, [Define this symbol if OpenSSL EC functions are available])
407401
SECP_TEST_INCLUDES="$SSL_CFLAGS $CRYPTO_CFLAGS $CRYPTO_CPPFLAGS"
408402
SECP_TEST_LIBS="$CRYPTO_LIBS"
@@ -412,27 +406,24 @@ if test x"$use_tests" = x"yes"; then
412406
SECP_TEST_LIBS="$SECP_TEST_LIBS -lgdi32"
413407
;;
414408
esac
415-
fi
416409
else
417410
if test x"$enable_openssl_tests" = x"yes"; then
418411
AC_MSG_ERROR([OpenSSL tests requested but OpenSSL with EC support is not available])
419412
fi
413+
enable_openssl_tests=no
420414
fi
421415
else
422416
if test x"$enable_openssl_tests" = x"yes"; then
423417
AC_MSG_ERROR([OpenSSL tests requested but tests are not enabled])
424418
fi
419+
enable_openssl_tests=no
425420
fi
426421

427422
if test x"$set_bignum" = x"gmp"; then
428423
SECP_LIBS="$SECP_LIBS $GMP_LIBS"
429424
SECP_INCLUDES="$SECP_INCLUDES $GMP_CPPFLAGS"
430425
fi
431426

432-
if test x"$use_endomorphism" = x"yes"; then
433-
AC_DEFINE(USE_ENDOMORPHISM, 1, [Define this symbol to use endomorphism optimization])
434-
fi
435-
436427
if test x"$set_precomp" = x"yes"; then
437428
AC_DEFINE(USE_ECMULT_STATIC_PRECOMPUTATION, 1, [Define this symbol to use a statically generated ecmult table])
438429
fi
@@ -468,14 +459,10 @@ if test x"$enable_experimental" = x"yes"; then
468459
AC_MSG_NOTICE([******])
469460
AC_MSG_NOTICE([WARNING: experimental build])
470461
AC_MSG_NOTICE([Experimental features do not have stable APIs or properties, and may not be safe for production use.])
471-
AC_MSG_NOTICE([Building ECDH module: $enable_module_ecdh])
472462
AC_MSG_NOTICE([Building extrakeys module: $enable_module_extrakeys])
473463
AC_MSG_NOTICE([Building schnorrsig module: $enable_module_schnorrsig])
474464
AC_MSG_NOTICE([******])
475465
else
476-
if test x"$enable_module_ecdh" = x"yes"; then
477-
AC_MSG_ERROR([ECDH module is experimental. Use --enable-experimental to allow.])
478-
fi
479466
if test x"$enable_module_extrakeys" = x"yes"; then
480467
AC_MSG_ERROR([extrakeys module is experimental. Use --enable-experimental to allow.])
481468
fi
@@ -514,10 +501,11 @@ AC_OUTPUT
514501

515502
echo
516503
echo "Build Options:"
517-
echo " with endomorphism = $use_endomorphism"
518504
echo " with ecmult precomp = $set_precomp"
519505
echo " with external callbacks = $use_external_default_callbacks"
520506
echo " with benchmarks = $use_benchmark"
507+
echo " with tests = $use_tests"
508+
echo " with openssl tests = $enable_openssl_tests"
521509
echo " with coverage = $enable_coverage"
522510
echo " module ecdh = $enable_module_ecdh"
523511
echo " module recovery = $enable_module_recovery"

0 commit comments

Comments
 (0)