From d217819bd7f8dcf18cb1af4ebe521417be091b6f Mon Sep 17 00:00:00 2001 From: Guido Vranken Date: Tue, 22 Jun 2021 05:21:23 +0200 Subject: [PATCH] [bitcoin-core] libsecp256k1: Compare against schnorr_fun, implement ECDH (#5958) --- projects/bitcoin-core/build_cryptofuzz.sh | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/projects/bitcoin-core/build_cryptofuzz.sh b/projects/bitcoin-core/build_cryptofuzz.sh index a827dc0a7..1ee7d0a48 100755 --- a/projects/bitcoin-core/build_cryptofuzz.sh +++ b/projects/bitcoin-core/build_cryptofuzz.sh @@ -40,11 +40,21 @@ function build_libsecp256k1() { make clean fi + SECP256K1_CONFIGURE_PARAMS=" + --enable-static + --disable-tests + --disable-benchmark + --disable-exhaustive-tests + --enable-module-recovery + --enable-experimental + --enable-module-schnorrsig + --enable-module-ecdh" + if [[ $CFLAGS = *sanitize=memory* ]] then - ./configure --enable-static --disable-tests --disable-benchmark --disable-exhaustive-tests --enable-module-recovery --enable-experimental --enable-module-schnorrsig --with-asm=no "$@" + ./configure $SECP256K1_CONFIGURE_PARAMS --with-asm=no "$@" else - ./configure --enable-static --disable-tests --disable-benchmark --disable-exhaustive-tests --enable-module-recovery --enable-experimental --enable-module-schnorrsig "$@" + ./configure $SECP256K1_CONFIGURE_PARAMS "$@" fi make @@ -97,6 +107,7 @@ echo -n 'ECDSA_Verify,' >>extra_options.h echo -n 'ECDSA_Recover,' >>extra_options.h echo -n 'Schnorr_Sign,' >>extra_options.h echo -n 'Schnorr_Verify,' >>extra_options.h +echo -n 'ECDH_Derive,' >>extra_options.h echo -n 'BignumCalc_Mod_2Exp256 ' >>extra_options.h echo -n '--curves=secp256k1 ' >>extra_options.h echo -n '--digests=NULL,SHA1,SHA256,SHA512,RIPEMD160,SHA3-256,SIPHASH64 ' >>extra_options.h @@ -110,6 +121,14 @@ cd ../trezor/ make -B -j$(nproc) cd ../botan/ make -B -j$(nproc) +cd ../schnorr_fun/ +export CXXFLAGS="$CXXFLAGS -DCRYPTOFUZZ_SCHNORR_FUN" +if [[ $CFLAGS != *-m32* ]] +then + make +else + make -f Makefile.i386 +fi cd ../../ # Build with 3 configurations of libsecp256k1