Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream PRs 831, 907, 903, 889, 918, 906, 928, 922, 933, Merge bitcoin-core/secp256k1#936: Fix gen_context/ASM build on ARM, 925, 937, 926, Merge bitcoin-core/secp256k1#940: contrib: Explain explicit header guards, 850, 930, 941, 846, 947, 662, 950 #132

Merged
merged 81 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
3d2cf6c
initialize variable in tests
PiRK Jan 29, 2021
99a1cfe
print warnings for conditional-uninitialized
PiRK Jan 31, 2021
de0a643
Add secp256k1_ctz{32,64}_var functions
sipa Oct 12, 2020
8e415ac
Add safegcd based modular inverse modules
peterdettman Nov 29, 2020
d8a92fc
Add extensive comments on the safegcd algorithm and implementation
sipa Dec 4, 2020
151aac0
Add tests for modinv modules
sipa Dec 23, 2020
08d5496
Improve bounds checks in modinv modules
sipa Dec 23, 2020
aa404d5
Move secp256k1_scalar_{inverse{_var},is_even} to per-impl files
sipa Oct 11, 2020
436281a
Move secp256k1_fe_inverse{_var} to per-impl files
sipa Oct 11, 2020
1e0e885
Make field/scalar code use the new modinv modules for inverses
sipa Nov 29, 2020
aa9cc52
Improve field/scalar inverse tests
sipa Oct 12, 2020
5437e7b
Remove unused scalar_sqr
sipa Jan 24, 2021
20448b8
Remove unused Jacobi symbol support
sipa Oct 11, 2020
1f233b3
Remove num/gmp support
sipa Oct 11, 2020
9164a1b
Optimization: special-case zero modulus limbs in modinv64
sipa Nov 28, 2020
b306935
Optimization: use formulas instead of lookup tables for cancelling g …
peterdettman Dec 16, 2020
ebc1af7
Optimization: track f,g limb count and pass to new variable-time upda…
peterdettman Dec 16, 2020
24ad04f
Make scalar_inverse{,_var} benchmark scale with SECP256K1_BENCH_ITERS
sipa Jan 22, 2021
23c3fb6
Make argument of fe_normalizes_to_zero{_var} const
sipa Mar 12, 2021
26de4df
Merge #831: Safegcd inverses, drop Jacobi symbols, remove libgmp
sipa Mar 18, 2021
4504472
changed import to use brackets <> for openssl as they are not local t…
whb07 Mar 20, 2021
6e89853
Merge #907: changed import to use brackets <> for openssl
jonasnick Mar 26, 2021
c083cc6
Merge #903: Make argument of fe_normalizes_to_zero{_var} const
jonasnick Mar 26, 2021
1e5d50f
Merge #889: fix uninitialized read in tests
jonasnick Apr 7, 2021
376ca36
Fix typo in explanation
sipa Mar 29, 2021
277b224
Use modified divsteps with initial delta=1/2 for constant-time
sipa Jan 1, 2021
cd393ce
Optimization: only do 59 hddivsteps per iteration instead of 62
sipa Jan 15, 2021
be0609f
Add unit tests for edge cases with delta=1/2 variant of divsteps
sipa Mar 26, 2021
a3aa262
gen_context: Don't include basic-config.h
real-or-random Apr 15, 2021
0706796
add ECMULT_GEN_PREC_BITS to basic_config.h
voisine Apr 10, 2021
cc2c09e
Merge #918: Clean up configuration in gen_context
jonasnick Apr 19, 2021
efad350
Merge #906: Use modified divsteps with initial delta=1/2 for constant…
real-or-random Apr 22, 2021
0881633
secp256k1.h: clarify that by default arguments must be != NULL
jonasnick Apr 28, 2021
4dc37bf
Add mingw32-w64/wine CI build
sipa Apr 17, 2021
ae9e648
Define SECP256K1_BUILD in secp256k1.c directly.
gmaxwell May 1, 2021
ed5a199
tests: fopen /dev/urandom in binary mode
real-or-random May 1, 2021
7012a18
Merge #928: Define SECP256K1_BUILD in secp256k1.c directly.
real-or-random May 2, 2021
34388af
Merge #922: Add mingw32-w64/wine CI build
jonasnick May 2, 2021
99e2d5b
Avoids a missing brace warning in schnorrsig/tests_impl.h on old comp…
gmaxwell May 2, 2021
98e0358
Merge #933: Avoids a missing brace warning in schnorrsig/tests_impl.h…
jonasnick May 3, 2021
99f47c2
gen_context: Don't use external ASM because it complicates the build
real-or-random May 3, 2021
2161f31
Makefile.am: Honor config when building gen_context
real-or-random May 3, 2021
c848352
Makefile.am: Don't pass a variable twice
real-or-random May 3, 2021
7d65ed5
Add ARM32/ARM64 CI
sipa May 2, 2021
8bbad7a
Add asm build to ARM32 CI
sipa May 2, 2021
d0bd269
Merge bitcoin-core/secp256k1#936: Fix gen_context/ASM build on ARM
sipa May 4, 2021
dd6c3de
Have secp256k1_ge_set_gej_var initialize all fields.
roconnor-blockstream May 4, 2021
31c0f6d
Have secp256k1_gej_double_var initialize all fields.
roconnor-blockstream May 4, 2021
45b6468
Have secp256k1_ge_set_all_gej_var initialize all fields.
roconnor-blockstream May 4, 2021
3c90bdd
change local lib headers to be relative for those pointing at "includ…
whb07 May 4, 2021
4a19668
tests: Test secp256k1_ge_set_all_gej_var for all infinity inputs
real-or-random May 5, 2021
14c9739
tests: Improve secp256k1_ge_set_all_gej_var for some infinity inputs
real-or-random May 5, 2021
185a6af
Merge #925: changed include statements without prefix 'include/'
real-or-random May 5, 2021
6c52ae8
Merge #937: Have ge_set_gej_var, gej_double_var and ge_set_all_gej_va…
real-or-random May 6, 2021
22a9ea1
contrib: Explain explicit header guards
real-or-random May 6, 2021
0d9561a
add `secp256k1_ec_pubkey_cmp` method
apoelstra Nov 22, 2020
6eceec6
add `secp256k1_xonly_pubkey_cmp` method
apoelstra Nov 30, 2020
6939487
Merge #926: secp256k1.h: clarify that by default arguments must be !=…
real-or-random May 7, 2021
1e78c18
Merge bitcoin-core/secp256k1#940: contrib: Explain explicit header gu…
sipa May 12, 2021
202a030
Merge #850: add `secp256k1_ec_pubkey_cmp` method
jonasnick May 13, 2021
bf0ac46
Merge #930: Add ARM32/ARM64 CI
jonasnick May 13, 2021
09b3bb8
Clean up git tree
real-or-random May 12, 2021
399722a
Merge #941: Clean up git tree
jonasnick May 14, 2021
de4157f
ci: Run ASan/LSan and reorganize sanitizer and Valgrind jobs
real-or-random Nov 9, 2020
fcfcb97
ci: Simplify to use generic wrapper for QEMU, Valgrind, etc
real-or-random May 17, 2021
489ff5c
tests: Treat empty SECP2561_TEST_ITERS as if it was unset
real-or-random May 21, 2021
02dcea1
ci: Make test iterations configurable and tweak for sanitizer builds
real-or-random May 17, 2021
3dc8c07
Merge #846: ci: Run ASan/LSan and reorganize sanitizer and Valgrind jobs
jonasnick May 21, 2021
a35fdd3
ci: Run PRs on merge result even for i686
real-or-random May 31, 2021
50f3367
Merge #947: ci: Run PRs on merge result even for i686
jonasnick May 31, 2021
593e6ba
Clean up ecmult_bench to make space for more benchmarks
jonasnick Sep 5, 2019
2fe1b50
Add ecmult_gen, ecmult_const and ecmult to benchmark
jonasnick Sep 5, 2019
8f879c2
Fix array size in bench_ecmult
jonasnick Oct 29, 2019
7973576
Merge #662: Add ecmult_gen, ecmult_const and ecmult to benchmark
real-or-random Jun 6, 2021
c58c4ea
ci: Add ppc64le build
real-or-random Jun 8, 2021
1758a92
Merge #950: ci: Add ppc64le build
jonasnick Jun 9, 2021
edcacc2
Merge commits '26de4dfe 6e898534 c083cc6e 1e5d50fa cc2c09e3 efad3506 …
jonasnick Jun 14, 2021
d27e459
Revert "Remove unused Jacobi symbol support"
jonasnick Jun 14, 2021
b053e85
ecdsa_adaptor: fix test case with invalid signature
jonasnick Jun 14, 2021
7226cf2
ecdsa_adaptor: fix too small buffer in tests
jonasnick Jun 14, 2021
f09497e
CI: tweak cirrus.yml to prevent OOM and timeout w sanitizer/valgrind
jonasnick Jun 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
197 changes: 149 additions & 48 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
env:
WIDEMUL: auto
BIGNUM: auto
STATICPRECOMPUTATION: yes
ECMULTGENPRECISION: auto
ASM: no
BUILD: check
WITH_VALGRIND: yes
RUN_VALGRIND: no
EXTRAFLAGS:
HOST:
ECDH: no
Expand All @@ -21,7 +19,8 @@ env:
EXPERIMENTAL: no
CTIMETEST: yes
BENCH: yes
ITERS: 2
TEST_ITERS:
BENCH_ITERS: 2
MAKEFLAGS: -j2

cat_logs_snippet: &CAT_LOGS
Expand Down Expand Up @@ -65,47 +64,13 @@ task:
- env: {WIDEMUL: int128, RECOVERY: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
- env: {WIDEMUL: int128, ECDH: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes, ECDSA_S2C: yes, RANGEPROOF: yes, WHITELIST: yes, GENERATOR: yes, MUSIG: yes, ECDSAADAPTOR: yes}
- env: {WIDEMUL: int128, ASM: x86_64}
- env: {BIGNUM: no}
- env: {BIGNUM: no, RECOVERY: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes, ECDSA_S2C: yes, RANGEPROOF: yes, WHITELIST: yes, GENERATOR: yes, MUSIG: yes, ECDSAADAPTOR: yes}
- env: {BIGNUM: no, STATICPRECOMPUTATION: no}
- env: { RECOVERY: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes, ECDSA_S2C: yes, RANGEPROOF: yes, WHITELIST: yes, GENERATOR: yes, MUSIG: yes, ECDSAADAPTOR: yes}
- env: { STATICPRECOMPUTATION: no}
- env: {BUILD: distcheck, WITH_VALGRIND: no, CTIMETEST: no, BENCH: no}
- env: {CPPFLAGS: -DDETERMINISTIC}
- env: {CFLAGS: -O0, CTIMETEST: no}
- env:
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
ECDSA_S2C: yes
RANGEPROOF: yes
WHITELIST: yes
GENERATOR: yes
MUSIG: yes
ECDSAADAPTOR: yes
CTIMETEST: no
- env: { ECMULTGENPRECISION: 2 }
- env: { ECMULTGENPRECISION: 8 }
- env:
RUN_VALGRIND: yes
BIGNUM: no
ASM: x86_64
ECDH: yes
RECOVERY: yes
EXPERIMENTAL: yes
SCHNORRSIG: yes
ECDSA_S2C: yes
RANGEPROOF: yes
WHITELIST: yes
GENERATOR: yes
MUSIG: yes
ECDSAADAPTOR: yes
EXTRAFLAGS: "--disable-openssl-tests"
BUILD:
matrix:
- env:
CC: gcc
Expand Down Expand Up @@ -139,11 +104,6 @@ task:
CC: i686-linux-gnu-gcc
- env:
CC: clang --target=i686-pc-linux-gnu -isystem /usr/i686-linux-gnu/include
matrix:
- env:
BIGNUM: gmp
- env:
BIGNUM: no
<< : *MERGE_BASE
test_script:
- ./ci/cirrus.sh
Expand Down Expand Up @@ -204,7 +164,7 @@ task:
# If we haven't restored from cached (and just run brew install), this is a no-op.
- brew link valgrind
brew_script:
- brew install automake libtool gmp gcc@9
- brew install automake libtool gcc@9
<< : *MERGE_BASE
test_script:
- ./ci/cirrus.sh
Expand All @@ -217,11 +177,10 @@ task:
cpu: 1
memory: 1G
env:
QEMU_CMD: qemu-s390x
WRAPPER_CMD: qemu-s390x
TEST_ITERS: 16
HOST: s390x-linux-gnu
BUILD:
WITH_VALGRIND: no
BIGNUM: no
ECDH: yes
RECOVERY: yes
EXPERIMENTAL: yes
Expand All @@ -239,3 +198,145 @@ task:
- rm /etc/ld.so.cache
- ./ci/cirrus.sh
<< : *CAT_LOGS

task:
name: "ARM32: Linux (Debian stable, QEMU)"
container:
dockerfile: ci/linux-debian.Dockerfile
cpu: 1
memory: 1G
env:
WRAPPER_CMD: qemu-arm
TEST_ITERS: 16
HOST: arm-linux-gnueabihf
WITH_VALGRIND: no
ECDH: yes
RECOVERY: yes
EXPERIMENTAL: yes
SCHNORRSIG: yes
CTIMETEST: no
matrix:
- env: {}
- env: {ASM: arm}
<< : *MERGE_BASE
test_script:
- ./ci/cirrus.sh
<< : *CAT_LOGS

task:
name: "ARM64: Linux (Debian stable, QEMU)"
container:
dockerfile: ci/linux-debian.Dockerfile
cpu: 1
memory: 1G
env:
WRAPPER_CMD: qemu-aarch64
TEST_ITERS: 16
HOST: aarch64-linux-gnu
WITH_VALGRIND: no
ECDH: yes
RECOVERY: yes
EXPERIMENTAL: yes
SCHNORRSIG: yes
CTIMETEST: no
<< : *MERGE_BASE
test_script:
- ./ci/cirrus.sh
<< : *CAT_LOGS

task:
name: "ppc64le: Linux (Debian stable, QEMU)"
container:
dockerfile: ci/linux-debian.Dockerfile
cpu: 1
memory: 1G
env:
WRAPPER_CMD: qemu-ppc64le
TEST_ITERS: 16
HOST: powerpc64le-linux-gnu
WITH_VALGRIND: no
ECDH: yes
RECOVERY: yes
EXPERIMENTAL: yes
SCHNORRSIG: yes
CTIMETEST: no
<< : *MERGE_BASE
test_script:
- ./ci/cirrus.sh
<< : *CAT_LOGS

task:
name: "x86_64 (mingw32-w64): Windows (Debian stable, Wine)"
container:
dockerfile: ci/linux-debian.Dockerfile
cpu: 1
memory: 1G
env:
WRAPPER_CMD: wine64-stable
TEST_ITERS: 16
HOST: x86_64-w64-mingw32
WITH_VALGRIND: no
ECDH: yes
RECOVERY: yes
EXPERIMENTAL: yes
SCHNORRSIG: yes
CTIMETEST: no
<< : *MERGE_BASE
test_script:
- ./ci/cirrus.sh
<< : *CAT_LOGS

# Sanitizers
task:
timeout_in: 120m
container:
dockerfile: ci/linux-debian.Dockerfile
cpu: 1
memory: 2G
env:
ECDH: yes
RECOVERY: yes
EXPERIMENTAL: yes
SCHNORRSIG: yes
ECDSA_S2C: yes
RANGEPROOF: yes
WHITELIST: yes
GENERATOR: yes
MUSIG: yes
ECDSAADAPTOR: yes
CTIMETEST: no
EXTRAFLAGS: "--disable-openssl-tests"
matrix:
- name: "Valgrind (memcheck)"
env:
# The `--error-exitcode` is required to make the test fail if valgrind found errors, otherwise it'll return 0 (https://www.valgrind.org/docs/manual/manual-core.html)
WRAPPER_CMD: "valgrind --error-exitcode=42"
TEST_ITERS: 8
- name: "UBSan, ASan, LSan"
env:
CFLAGS: "-fsanitize=undefined,address"
CFLAGS_FOR_BUILD: "-fsanitize=undefined,address"
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
ASAN_OPTIONS: "strict_string_checks=1:detect_stack_use_after_return=1:detect_leaks=1"
LSAN_OPTIONS: "use_unaligned=1"
TEST_ITERS: 32
# Try to cover many configurations with just a tiny matrix.
matrix:
- env:
ASM: auto
STATICPRECOMPUTATION: yes
- env:
ASM: no
STATICPRECOMPUTATION: no
ECMULTGENPRECISION: 2
matrix:
- env:
CC: clang
- env:
HOST: i686-linux-gnu
CC: i686-linux-gnu-gcc
<< : *MERGE_BASE
test_script:
- ./ci/cirrus.sh
<< : *CAT_LOGS

8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ libtool
*~
*.log
*.trs

coverage/
coverage.html
coverage.*.html
*.gcda
*.gcno
*.gcov

src/libsecp256k1-config.h
src/libsecp256k1-config.h.in
src/ecmult_static_context.h
Expand Down
24 changes: 12 additions & 12 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ noinst_HEADERS += src/scalar_8x32_impl.h
noinst_HEADERS += src/scalar_low_impl.h
noinst_HEADERS += src/group.h
noinst_HEADERS += src/group_impl.h
noinst_HEADERS += src/num_gmp.h
noinst_HEADERS += src/num_gmp_impl.h
noinst_HEADERS += src/eccommit.h
noinst_HEADERS += src/eccommit_impl.h
noinst_HEADERS += src/ecdsa.h
Expand All @@ -28,14 +26,16 @@ noinst_HEADERS += src/ecmult_const.h
noinst_HEADERS += src/ecmult_const_impl.h
noinst_HEADERS += src/ecmult_gen.h
noinst_HEADERS += src/ecmult_gen_impl.h
noinst_HEADERS += src/num.h
noinst_HEADERS += src/num_impl.h
noinst_HEADERS += src/field_10x26.h
noinst_HEADERS += src/field_10x26_impl.h
noinst_HEADERS += src/field_5x52.h
noinst_HEADERS += src/field_5x52_impl.h
noinst_HEADERS += src/field_5x52_int128_impl.h
noinst_HEADERS += src/field_5x52_asm_impl.h
noinst_HEADERS += src/modinv32.h
noinst_HEADERS += src/modinv32_impl.h
noinst_HEADERS += src/modinv64.h
noinst_HEADERS += src/modinv64_impl.h
noinst_HEADERS += src/assumptions.h
noinst_HEADERS += src/util.h
noinst_HEADERS += src/scratch.h
Expand Down Expand Up @@ -70,7 +70,7 @@ endif
endif

libsecp256k1_la_SOURCES = src/secp256k1.c
libsecp256k1_la_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/include -I$(top_srcdir)/src $(SECP_INCLUDES)
libsecp256k1_la_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src $(SECP_INCLUDES)
libsecp256k1_la_LIBADD = $(SECP_LIBS) $(COMMON_LIB)

if VALGRIND_ENABLED
Expand All @@ -83,27 +83,27 @@ noinst_PROGRAMS += bench_verify bench_sign bench_internal bench_ecmult
bench_verify_SOURCES = src/bench_verify.c
bench_verify_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
# SECP_TEST_INCLUDES are only used here for CRYPTO_CPPFLAGS
bench_verify_CPPFLAGS = -DSECP256K1_BUILD $(SECP_TEST_INCLUDES)
bench_verify_CPPFLAGS = $(SECP_TEST_INCLUDES)
bench_sign_SOURCES = src/bench_sign.c
bench_sign_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
bench_internal_SOURCES = src/bench_internal.c
bench_internal_LDADD = $(SECP_LIBS) $(COMMON_LIB)
bench_internal_CPPFLAGS = -DSECP256K1_BUILD $(SECP_INCLUDES)
bench_internal_CPPFLAGS = $(SECP_INCLUDES)
bench_ecmult_SOURCES = src/bench_ecmult.c
bench_ecmult_LDADD = $(SECP_LIBS) $(COMMON_LIB)
bench_ecmult_CPPFLAGS = -DSECP256K1_BUILD $(SECP_INCLUDES)
bench_ecmult_CPPFLAGS = $(SECP_INCLUDES)
endif

TESTS =
if USE_TESTS
noinst_PROGRAMS += tests
tests_SOURCES = src/tests.c
tests_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/src -I$(top_srcdir)/include $(SECP_INCLUDES) $(SECP_TEST_INCLUDES)
tests_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/include $(SECP_INCLUDES) $(SECP_TEST_INCLUDES)
if VALGRIND_ENABLED
tests_CPPFLAGS += -DVALGRIND
noinst_PROGRAMS += valgrind_ctime_test
valgrind_ctime_test_SOURCES = src/valgrind_ctime_test.c
valgrind_ctime_test_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_LIBS) $(COMMON_LIB)
valgrind_ctime_test_LDADD = libsecp256k1.la $(SECP_LIBS) $(COMMON_LIB)
endif
if !ENABLE_COVERAGE
tests_CPPFLAGS += -DVERIFY
Expand All @@ -116,7 +116,7 @@ endif
if USE_EXHAUSTIVE_TESTS
noinst_PROGRAMS += exhaustive_tests
exhaustive_tests_SOURCES = src/tests_exhaustive.c
exhaustive_tests_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/src $(SECP_INCLUDES)
exhaustive_tests_CPPFLAGS = -I$(top_srcdir)/src $(SECP_INCLUDES)
if !ENABLE_COVERAGE
exhaustive_tests_CPPFLAGS += -DVERIFY
endif
Expand All @@ -131,7 +131,7 @@ CPPFLAGS_FOR_BUILD +=-I$(top_srcdir) -I$(builddir)/src
gen_context_OBJECTS = gen_context.o
gen_context_BIN = gen_context$(BUILD_EXEEXT)
gen_%.o: src/gen_%.c src/libsecp256k1-config.h
$(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -c $< -o $@
$(CC_FOR_BUILD) $(DEFS) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -c $< -o $@

$(gen_context_BIN): $(gen_context_OBJECTS)
$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $^ -o $@
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ Implementation details
* Optimized implementation of arithmetic modulo the curve's field size (2^256 - 0x1000003D1).
* Using 5 52-bit limbs (including hand-optimized assembly for x86_64, by Diederik Huys).
* Using 10 26-bit limbs (including hand-optimized assembly for 32-bit ARM, by Wladimir J. van der Laan).
* Field inverses and square roots using a sliding window over blocks of 1s (by Peter Dettman).
* Scalar operations
* Optimized implementation without data-dependent branches of arithmetic modulo the curve's order.
* Using 4 64-bit limbs (relying on __int128 support in the compiler).
* Using 8 32-bit limbs.
* Modular inverses (both field elements and scalars) based on [safegcd](https://gcd.cr.yp.to/index.html) with some modifications, and a variable-time variant (by Peter Dettman).
* Group operations
* Point addition formula specifically simplified for the curve equation (y^2 = x^3 + 7).
* Use addition between points in Jacobian and affine coordinates where possible.
Expand Down Expand Up @@ -97,7 +97,8 @@ To create a report, `gcovr` is recommended, as it includes branch coverage repor

To create a HTML report with coloured and annotated source code:

$ gcovr --exclude 'src/bench*' --html --html-details -o coverage.html
$ mkdir -p coverage
$ gcovr --exclude 'src/bench*' --html --html-details -o coverage/coverage.html

Reporting a vulnerability
------------
Expand Down
13 changes: 0 additions & 13 deletions build-aux/m4/bitcoin_secp.m4
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,6 @@ if test x"$has_libcrypto" = x"yes" && test x"$has_openssl_ec" = x; then
fi
])

dnl
AC_DEFUN([SECP_GMP_CHECK],[
if test x"$has_gmp" != x"yes"; then
CPPFLAGS_TEMP="$CPPFLAGS"
CPPFLAGS="$GMP_CPPFLAGS $CPPFLAGS"
LIBS_TEMP="$LIBS"
LIBS="$GMP_LIBS $LIBS"
AC_CHECK_HEADER(gmp.h,[AC_CHECK_LIB(gmp, __gmpz_init,[has_gmp=yes; GMP_LIBS="$GMP_LIBS -lgmp"; AC_DEFINE(HAVE_LIBGMP,1,[Define this symbol if libgmp is installed])])])
CPPFLAGS="$CPPFLAGS_TEMP"
LIBS="$LIBS_TEMP"
fi
])

AC_DEFUN([SECP_VALGRIND_CHECK],[
if test x"$has_valgrind" != x"yes"; then
CPPFLAGS_TEMP="$CPPFLAGS"
Expand Down
Loading