Skip to content

Commit 97a4e87

Browse files
committed
Remove num/gmp support
1 parent 62c26e2 commit 97a4e87

19 files changed

+7
-808
lines changed

.travis.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,31 @@ osx_image: xcode10.1
99
addons:
1010
apt:
1111
packages:
12-
- libgmp-dev
1312
- valgrind
1413
- libtool-bin
1514
compiler:
1615
- clang
1716
- gcc
1817
env:
1918
global:
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
19+
- WIDEMUL=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
2120
matrix:
2221
- WIDEMUL=int64 RECOVERY=yes
2322
- WIDEMUL=int64 ECDH=yes EXPERIMENTAL=yes SCHNORRSIG=yes
2423
- WIDEMUL=int128
2524
- WIDEMUL=int128 RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes
2625
- WIDEMUL=int128 ECDH=yes EXPERIMENTAL=yes SCHNORRSIG=yes
2726
- WIDEMUL=int128 ASM=x86_64
28-
- BIGNUM=no
29-
- BIGNUM=no RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes
30-
- BIGNUM=no STATICPRECOMPUTATION=no
27+
- WIDEMUL=int128 ASM=x86_64
28+
- RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes
29+
- STATICPRECOMPUTATION=no
3130
- BUILD=distcheck WITH_VALGRIND=no CTIMETEST=no BENCH=no
3231
- CPPFLAGS=-DDETERMINISTIC
3332
- CFLAGS=-O0 CTIMETEST=no
3433
- 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
3534
- ECMULTGENPRECISION=2
3635
- ECMULTGENPRECISION=8
37-
- RUN_VALGRIND=yes BIGNUM=no ASM=x86_64 ECDH=yes RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes EXTRAFLAGS="--disable-openssl-tests" BUILD=
36+
- RUN_VALGRIND=yes ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes EXTRAFLAGS="--disable-openssl-tests" BUILD=
3837
matrix:
3938
fast_finish: true
4039
include:
@@ -45,7 +44,6 @@ matrix:
4544
apt:
4645
packages:
4746
- gcc-multilib
48-
- libgmp-dev:i386
4947
- valgrind
5048
- libtool-bin
5149
- libc6-dbg:i386
@@ -76,7 +74,6 @@ matrix:
7674
apt:
7775
packages:
7876
- gcc-multilib
79-
- libgmp-dev:i386
8077
- valgrind
8178
- libtool-bin
8279
- libc6-dbg:i386
@@ -89,7 +86,7 @@ matrix:
8986
# because in xcode earlier than 11 they have a bug requiring updating the system which overall takes ~8 minutes.
9087
# https://travis-ci.community/t/macos-build-fails-because-of-homebrew-bundle-unknown-command/7296
9188
before_install:
92-
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then HOMEBREW_NO_AUTO_UPDATE=1 brew install gmp valgrind gcc@9; fi
89+
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then HOMEBREW_NO_AUTO_UPDATE=1 brew install valgrind gcc@9; fi
9390

9491
before_script: ./autogen.sh
9592

Makefile.am

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ noinst_HEADERS += src/scalar_8x32_impl.h
1414
noinst_HEADERS += src/scalar_low_impl.h
1515
noinst_HEADERS += src/group.h
1616
noinst_HEADERS += src/group_impl.h
17-
noinst_HEADERS += src/num_gmp.h
18-
noinst_HEADERS += src/num_gmp_impl.h
1917
noinst_HEADERS += src/ecdsa.h
2018
noinst_HEADERS += src/ecdsa_impl.h
2119
noinst_HEADERS += src/eckey.h
@@ -26,8 +24,6 @@ noinst_HEADERS += src/ecmult_const.h
2624
noinst_HEADERS += src/ecmult_const_impl.h
2725
noinst_HEADERS += src/ecmult_gen.h
2826
noinst_HEADERS += src/ecmult_gen_impl.h
29-
noinst_HEADERS += src/num.h
30-
noinst_HEADERS += src/num_impl.h
3127
noinst_HEADERS += src/field_10x26.h
3228
noinst_HEADERS += src/field_10x26_impl.h
3329
noinst_HEADERS += src/field_5x52.h

configure.ac

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,11 @@ case $host_os in
4242
dnl Homebrew where each one is located, then adjust paths accordingly.
4343

4444
openssl_prefix=`$BREW --prefix openssl 2>/dev/null`
45-
gmp_prefix=`$BREW --prefix gmp 2>/dev/null`
4645
if test x$openssl_prefix != x; then
4746
PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
4847
export PKG_CONFIG_PATH
4948
CRYPTO_CPPFLAGS="-I$openssl_prefix/include"
5049
fi
51-
if test x$gmp_prefix != x; then
52-
GMP_CPPFLAGS="-I$gmp_prefix/include"
53-
GMP_LIBS="-L$gmp_prefix/lib"
54-
fi
5550
else
5651
AC_PATH_PROG([PORT],port,)
5752
dnl if homebrew isn't installed and macports is, add the macports default paths
@@ -150,9 +145,6 @@ dnl Test-only override of the (autodetected by the C code) "widemul" setting.
150145
dnl Legal values are int64 (for [u]int64_t), int128 (for [unsigned] __int128), and auto (the default).
151146
AC_ARG_WITH([test-override-wide-multiply], [] ,[set_widemul=$withval], [set_widemul=auto])
152147

153-
AC_ARG_WITH([bignum], [AS_HELP_STRING([--with-bignum=gmp|no|auto],
154-
[bignum implementation to use [default=auto]])],[req_bignum=$withval], [req_bignum=auto])
155-
156148
AC_ARG_WITH([asm], [AS_HELP_STRING([--with-asm=x86_64|arm|no|auto],
157149
[assembly optimizations to use (experimental: arm) [default=auto]])],[req_asm=$withval], [req_asm=auto])
158150

@@ -279,32 +271,6 @@ else
279271
esac
280272
fi
281273

282-
if test x"$req_bignum" = x"auto"; then
283-
SECP_GMP_CHECK
284-
if test x"$has_gmp" = x"yes"; then
285-
set_bignum=gmp
286-
fi
287-
288-
if test x"$set_bignum" = x; then
289-
set_bignum=no
290-
fi
291-
else
292-
set_bignum=$req_bignum
293-
case $set_bignum in
294-
gmp)
295-
SECP_GMP_CHECK
296-
if test x"$has_gmp" != x"yes"; then
297-
AC_MSG_ERROR([gmp bignum explicitly requested but libgmp not available])
298-
fi
299-
;;
300-
no)
301-
;;
302-
*)
303-
AC_MSG_ERROR([invalid bignum implementation selection])
304-
;;
305-
esac
306-
fi
307-
308274
# select assembly optimization
309275
use_external_asm=no
310276

@@ -337,24 +303,6 @@ auto)
337303
;;
338304
esac
339305

340-
# select bignum implementation
341-
case $set_bignum in
342-
gmp)
343-
AC_DEFINE(HAVE_LIBGMP, 1, [Define this symbol if libgmp is installed])
344-
AC_DEFINE(USE_NUM_GMP, 1, [Define this symbol to use the gmp implementation for num])
345-
AC_DEFINE(USE_FIELD_INV_NUM, 1, [Define this symbol to use the num-based field inverse implementation])
346-
AC_DEFINE(USE_SCALAR_INV_NUM, 1, [Define this symbol to use the num-based scalar inverse implementation])
347-
;;
348-
no)
349-
AC_DEFINE(USE_NUM_NONE, 1, [Define this symbol to use no num implementation])
350-
AC_DEFINE(USE_FIELD_INV_BUILTIN, 1, [Define this symbol to use the native field inverse implementation])
351-
AC_DEFINE(USE_SCALAR_INV_BUILTIN, 1, [Define this symbol to use the native scalar inverse implementation])
352-
;;
353-
*)
354-
AC_MSG_ERROR([invalid bignum implementation])
355-
;;
356-
esac
357-
358306
#set ecmult window size
359307
if test x"$req_ecmult_window" = x"auto"; then
360308
set_ecmult_window=15
@@ -419,11 +367,6 @@ else
419367
enable_openssl_tests=no
420368
fi
421369

422-
if test x"$set_bignum" = x"gmp"; then
423-
SECP_LIBS="$SECP_LIBS $GMP_LIBS"
424-
SECP_INCLUDES="$SECP_INCLUDES $GMP_CPPFLAGS"
425-
fi
426-
427370
if test x"$set_precomp" = x"yes"; then
428371
AC_DEFINE(USE_ECMULT_STATIC_PRECOMPUTATION, 1, [Define this symbol to use a statically generated ecmult table])
429372
fi
@@ -513,7 +456,6 @@ echo " module extrakeys = $enable_module_extrakeys"
513456
echo " module schnorrsig = $enable_module_schnorrsig"
514457
echo
515458
echo " asm = $set_asm"
516-
echo " bignum = $set_bignum"
517459
echo " ecmult window size = $set_ecmult_window"
518460
echo " ecmult gen prec. bits = $set_ecmult_gen_precision"
519461
dnl Hide test-only options unless they're used.

contrib/travis.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fi
1414

1515
./configure \
1616
--enable-experimental="$EXPERIMENTAL" \
17-
--with-test-override-wide-multiply="$WIDEMUL" --with-bignum="$BIGNUM" --with-asm="$ASM" \
17+
--with-test-override-wide-multiply="$WIDEMUL" --with-asm="$ASM" \
1818
--enable-ecmult-static-precomputation="$STATICPRECOMPUTATION" --with-ecmult-gen-precision="$ECMULTGENPRECISION" \
1919
--enable-module-ecdh="$ECDH" --enable-module-recovery="$RECOVERY" \
2020
--enable-module-schnorrsig="$SCHNORRSIG" \

src/basic-config.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,10 @@
1313
#undef USE_ECMULT_STATIC_PRECOMPUTATION
1414
#undef USE_EXTERNAL_ASM
1515
#undef USE_EXTERNAL_DEFAULT_CALLBACKS
16-
#undef USE_FIELD_INV_BUILTIN
17-
#undef USE_FIELD_INV_NUM
18-
#undef USE_NUM_GMP
19-
#undef USE_NUM_NONE
20-
#undef USE_SCALAR_INV_BUILTIN
21-
#undef USE_SCALAR_INV_NUM
2216
#undef USE_FORCE_WIDEMUL_INT64
2317
#undef USE_FORCE_WIDEMUL_INT128
2418
#undef ECMULT_WINDOW_SIZE
2519

26-
#define USE_NUM_NONE 1
27-
#define USE_FIELD_INV_BUILTIN 1
28-
#define USE_SCALAR_INV_BUILTIN 1
2920
#define USE_WIDEMUL_64 1
3021
#define ECMULT_WINDOW_SIZE 15
3122

src/bench_ecmult.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#include "util.h"
1111
#include "hash_impl.h"
12-
#include "num_impl.h"
1312
#include "field_impl.h"
1413
#include "group_impl.h"
1514
#include "scalar_impl.h"

src/bench_internal.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "assumptions.h"
1111
#include "util.h"
1212
#include "hash_impl.h"
13-
#include "num_impl.h"
1413
#include "field_impl.h"
1514
#include "group_impl.h"
1615
#include "scalar_impl.h"

src/ecmult.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#ifndef SECP256K1_ECMULT_H
88
#define SECP256K1_ECMULT_H
99

10-
#include "num.h"
1110
#include "group.h"
1211
#include "scalar.h"
1312
#include "scratch.h"

src/field_impl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#endif
1313

1414
#include "util.h"
15-
#include "num.h"
1615

1716
#if defined(SECP256K1_WIDEMUL_INT128)
1817
#include "field_5x52_impl.h"

src/group.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#ifndef SECP256K1_GROUP_H
88
#define SECP256K1_GROUP_H
99

10-
#include "num.h"
1110
#include "field.h"
1211

1312
/** A group element of the secp256k1 curve, in affine coordinates. */

0 commit comments

Comments
 (0)