Skip to content

Commit 607e788

Browse files
committed
Remove num/gmp support
1 parent ad9a5cd commit 607e788

19 files changed

+7
-809
lines changed

.travis.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ 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 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
19+
- WIDEMUL=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
2120
matrix:
2221
- WIDEMUL=int64 RECOVERY=yes
2322
- WIDEMUL=int64 ECDH=yes EXPERIMENTAL=yes SCHNORRSIG=yes
@@ -28,16 +27,15 @@ env:
2827
- WIDEMUL=int128 ENDOMORPHISM=yes ECDH=yes EXPERIMENTAL=yes SCHNORRSIG=yes
2928
- WIDEMUL=int128 ASM=x86_64
3029
- WIDEMUL=int128 ENDOMORPHISM=yes ASM=x86_64
31-
- BIGNUM=no
32-
- BIGNUM=no ENDOMORPHISM=yes RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes
33-
- BIGNUM=no STATICPRECOMPUTATION=no
30+
- ENDOMORPHISM=yes RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes
31+
- STATICPRECOMPUTATION=no
3432
- BUILD=distcheck WITH_VALGRIND=no CTIMETEST=no BENCH=no
3533
- CPPFLAGS=-DDETERMINISTIC
3634
- CFLAGS=-O0 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 ENDOMORPHISM=yes ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes EXTRAFLAGS="--disable-openssl-tests" BUILD=
38+
- RUN_VALGRIND=yes ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes EXTRAFLAGS="--disable-openssl-tests" BUILD=
4139
matrix:
4240
fast_finish: true
4341
include:
@@ -48,7 +46,6 @@ matrix:
4846
apt:
4947
packages:
5048
- gcc-multilib
51-
- libgmp-dev:i386
5249
- valgrind
5350
- libtool-bin
5451
- libc6-dbg:i386
@@ -79,7 +76,6 @@ matrix:
7976
apt:
8077
packages:
8178
- gcc-multilib
82-
- libgmp-dev:i386
8379
- valgrind
8480
- libtool-bin
8581
- libc6-dbg:i386
@@ -92,7 +88,7 @@ matrix:
9288
# because in xcode earlier than 11 they have a bug requiring updating the system which overall takes ~8 minutes.
9389
# https://travis-ci.community/t/macos-build-fails-because-of-homebrew-bundle-unknown-command/7296
9490
before_install:
95-
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then HOMEBREW_NO_AUTO_UPDATE=1 brew install gmp valgrind gcc@9; fi
91+
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then HOMEBREW_NO_AUTO_UPDATE=1 brew install valgrind gcc@9; fi
9692

9793
before_script: ./autogen.sh
9894

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
@@ -155,9 +150,6 @@ dnl Test-only override of the (autodetected by the C code) "widemul" setting.
155150
dnl Legal values are int64 (for [u]int64_t), int128 (for [unsigned] __int128), and auto (the default).
156151
AC_ARG_WITH([test-override-wide-multiply], [] ,[set_widemul=$withval], [set_widemul=auto])
157152

158-
AC_ARG_WITH([bignum], [AS_HELP_STRING([--with-bignum=gmp|no|auto],
159-
[bignum implementation to use [default=auto]])],[req_bignum=$withval], [req_bignum=auto])
160-
161153
AC_ARG_WITH([asm], [AS_HELP_STRING([--with-asm=x86_64|arm|no|auto],
162154
[assembly optimizations to use (experimental: arm) [default=auto]])],[req_asm=$withval], [req_asm=auto])
163155

@@ -285,32 +277,6 @@ else
285277
esac
286278
fi
287279

288-
if test x"$req_bignum" = x"auto"; then
289-
SECP_GMP_CHECK
290-
if test x"$has_gmp" = x"yes"; then
291-
set_bignum=gmp
292-
fi
293-
294-
if test x"$set_bignum" = x; then
295-
set_bignum=no
296-
fi
297-
else
298-
set_bignum=$req_bignum
299-
case $set_bignum in
300-
gmp)
301-
SECP_GMP_CHECK
302-
if test x"$has_gmp" != x"yes"; then
303-
AC_MSG_ERROR([gmp bignum explicitly requested but libgmp not available])
304-
fi
305-
;;
306-
no)
307-
;;
308-
*)
309-
AC_MSG_ERROR([invalid bignum implementation selection])
310-
;;
311-
esac
312-
fi
313-
314280
# select assembly optimization
315281
use_external_asm=no
316282

@@ -343,24 +309,6 @@ auto)
343309
;;
344310
esac
345311

346-
# select bignum implementation
347-
case $set_bignum in
348-
gmp)
349-
AC_DEFINE(HAVE_LIBGMP, 1, [Define this symbol if libgmp is installed])
350-
AC_DEFINE(USE_NUM_GMP, 1, [Define this symbol to use the gmp implementation for num])
351-
AC_DEFINE(USE_FIELD_INV_NUM, 1, [Define this symbol to use the num-based field inverse implementation])
352-
AC_DEFINE(USE_SCALAR_INV_NUM, 1, [Define this symbol to use the num-based scalar inverse implementation])
353-
;;
354-
no)
355-
AC_DEFINE(USE_NUM_NONE, 1, [Define this symbol to use no num implementation])
356-
AC_DEFINE(USE_FIELD_INV_BUILTIN, 1, [Define this symbol to use the native field inverse implementation])
357-
AC_DEFINE(USE_SCALAR_INV_BUILTIN, 1, [Define this symbol to use the native scalar inverse implementation])
358-
;;
359-
*)
360-
AC_MSG_ERROR([invalid bignum implementation])
361-
;;
362-
esac
363-
364312
#set ecmult window size
365313
if test x"$req_ecmult_window" = x"auto"; then
366314
set_ecmult_window=15
@@ -424,11 +372,6 @@ else
424372
fi
425373
fi
426374

427-
if test x"$set_bignum" = x"gmp"; then
428-
SECP_LIBS="$SECP_LIBS $GMP_LIBS"
429-
SECP_INCLUDES="$SECP_INCLUDES $GMP_CPPFLAGS"
430-
fi
431-
432375
if test x"$use_endomorphism" = x"yes"; then
433376
AC_DEFINE(USE_ENDOMORPHISM, 1, [Define this symbol to use endomorphism optimization])
434377
fi
@@ -525,7 +468,6 @@ echo " module extrakeys = $enable_module_extrakeys"
525468
echo " module schnorrsig = $enable_module_schnorrsig"
526469
echo
527470
echo " asm = $set_asm"
528-
echo " bignum = $set_bignum"
529471
echo " ecmult window size = $set_ecmult_window"
530472
echo " ecmult gen prec. bits = $set_ecmult_gen_precision"
531473
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" --enable-endomorphism="$ENDOMORPHISM" \
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
@@ -14,19 +14,10 @@
1414
#undef USE_ENDOMORPHISM
1515
#undef USE_EXTERNAL_ASM
1616
#undef USE_EXTERNAL_DEFAULT_CALLBACKS
17-
#undef USE_FIELD_INV_BUILTIN
18-
#undef USE_FIELD_INV_NUM
19-
#undef USE_NUM_GMP
20-
#undef USE_NUM_NONE
21-
#undef USE_SCALAR_INV_BUILTIN
22-
#undef USE_SCALAR_INV_NUM
2317
#undef USE_FORCE_WIDEMUL_INT64
2418
#undef USE_FORCE_WIDEMUL_INT128
2519
#undef ECMULT_WINDOW_SIZE
2620

27-
#define USE_NUM_NONE 1
28-
#define USE_FIELD_INV_BUILTIN 1
29-
#define USE_SCALAR_INV_BUILTIN 1
3021
#define USE_WIDEMUL_64 1
3122
#define ECMULT_WINDOW_SIZE 15
3223

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)