Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: BlockstreamResearch/secp256k1-zkp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 98d3dd7df5e255ce164188320f72b2dd45946408
Choose a base ref
..
head repository: BlockstreamResearch/secp256k1-zkp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f497863f98965686dbb8789f3cd295be8f65db1d
Choose a head ref
Showing with 11,649 additions and 1,928 deletions.
  1. +37 −55 .cirrus.yml
  2. +2 −1 .gitattributes
  3. +4 −9 .gitignore
  4. +56 −36 Makefile.am
  5. +13 −10 README.md
  6. +2 −2 SECURITY.md
  7. +0 −125 build-aux/m4/ax_prog_cc_for_build.m4
  8. +7 −67 build-aux/m4/bitcoin_secp.m4
  9. +16 −20 ci/cirrus.sh
  10. +28 −140 configure.ac
  11. +12 −0 doc/CHANGELOG.md
  12. +14 −0 doc/release-process.md
  13. +10 −4 doc/safegcd_implementation.md
  14. +1 −1 include/secp256k1.h
  15. +3 −2 include/secp256k1_schnorrsig.h
  16. +3 −0 sage/secp256k1_params.sage
  17. +234 −0 src/bench.c
  18. +51 −12 src/bench.h
  19. +19 −14 src/bench_ecmult.c
  20. +34 −32 src/bench_internal.c
  21. +0 −58 src/bench_sign.c
  22. +0 −115 src/bench_verify.c
  23. +3 −3 src/ecdsa_impl.h
  24. +16 −0 src/ecmult_compute_table.h
  25. +49 −0 src/ecmult_compute_table_impl.h
  26. +1 −0 src/ecmult_const.h
  27. +35 −55 src/ecmult_const_impl.h
  28. +9 −22 src/ecmult_gen.h
  29. +14 −0 src/ecmult_gen_compute_table.h
  30. +81 −0 src/ecmult_gen_compute_table_impl.h
  31. +29 −105 src/ecmult_gen_impl.h
  32. +11 −24 src/ecmult_impl.h
  33. +5 −3 src/field.h
  34. +16 −1 src/field_10x26_impl.h
  35. +18 −6 src/field_5x52_impl.h
  36. +22 −23 src/field_5x52_int128_impl.h
  37. +0 −95 src/gen_context.c
  38. +0 −137 src/gen_ecmult_static_pre_g.c
  39. +3 −0 src/group.h
  40. +9 −0 src/group_impl.h
  41. +1 −5 src/modules/ecdh/Makefile.am.include
  42. +7 −9 src/{bench_ecdh.c → modules/ecdh/bench_impl.h}
  43. +33 −29 src/modules/ecdsa_adaptor/tests_impl.h
  44. +18 −15 src/modules/ecdsa_s2c/tests_impl.h
  45. +15 −7 src/modules/extrakeys/tests_impl.h
  46. +18 −12 src/modules/generator/tests_impl.h
  47. +24 −20 src/modules/musig/tests_impl.h
  48. +81 −75 src/modules/rangeproof/tests_impl.h
  49. +1 −5 src/modules/recovery/Makefile.am.include
  50. +8 −8 src/{bench_recover.c → modules/recovery/bench_impl.h}
  51. +17 −11 src/modules/recovery/tests_impl.h
  52. +1 −5 src/modules/schnorrsig/Makefile.am.include
  53. +9 −12 src/{bench_schnorrsig.c → modules/schnorrsig/bench_impl.h}
  54. +16 −8 src/modules/schnorrsig/main_impl.h
  55. +39 −28 src/modules/schnorrsig/tests_impl.h
  56. +36 −29 src/modules/surjection/tests_impl.h
  57. +96 −0 src/precompute_ecmult.c
  58. +80 −0 src/precompute_ecmult_gen.c
  59. +40 −191 src/{ecmult_static_pre_g.h → precomputed_ecmult.c}
  60. +35 −0 src/precomputed_ecmult.h
  61. +9,750 −0 src/precomputed_ecmult_gen.c
  62. +26 −0 src/precomputed_ecmult_gen.h
  63. +1 −1 src/scalar_impl.h
  64. +6 −48 src/secp256k1.c
  65. +5 −2 src/testrand.h
  66. +56 −17 src/testrand_impl.h
  67. +330 −182 src/tests.c
  68. +6 −2 src/tests_exhaustive.c
  69. +27 −30 src/util.h
92 changes: 37 additions & 55 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -4,10 +4,10 @@ env:
# Specific warnings can be disabled with -Wno-error=foo.
# -pedantic-errors is not equivalent to -Werror=pedantic and thus not implied by -Werror according to the GCC manual.
WERROR_CFLAGS: -Werror -pedantic-errors
MAKEFLAGS: -j2
MAKEFLAGS: -j4
BUILD: check
### secp256k1 config
STATICPRECOMPUTATION: yes
ECMULTWINDOW: auto
ECMULTGENPRECISION: auto
ASM: no
WIDEMUL: auto
@@ -24,9 +24,9 @@ env:
MUSIG: no
ECDSAADAPTOR: no
### test options
TEST_ITERS:
SECP256K1_TEST_ITERS:
BENCH: yes
BENCH_ITERS: 2
SECP256K1_BENCH_ITERS: 2
CTIMETEST: yes

cat_logs_snippet: &CAT_LOGS
@@ -55,14 +55,19 @@ merge_base_script_snippet: &MERGE_BASE
- git config --global user.name "ci"
- git merge FETCH_HEAD # Merge base to detect silent merge conflicts

task:
name: "x86_64: Linux (Debian stable)"
linux_container_snippet: &LINUX_CONTAINER
container:
dockerfile: ci/linux-debian.Dockerfile
# Reduce number of CPUs to be able to do more builds in parallel.
cpu: 1
# Gives us more CPUs for free if they're available.
greedy: true
# More than enough for our scripts.
memory: 1G

task:
name: "x86_64: Linux (Debian stable)"
<< : *LINUX_CONTAINER
matrix: &ENV_MATRIX
- env: {WIDEMUL: int64, RECOVERY: yes}
- env: {WIDEMUL: int64, ECDH: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes, ECDSA_S2C: yes, RANGEPROOF: yes, WHITELIST: yes, GENERATOR: yes, MUSIG: yes, ECDSAADAPTOR: yes}
@@ -71,12 +76,11 @@ task:
- 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: { 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: { ECMULTGENPRECISION: 2 }
- env: { ECMULTGENPRECISION: 8 }
- env: { ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
- env: { ECMULTGENPRECISION: 8, ECMULTWINDOW: 4 }
matrix:
- env:
CC: gcc
@@ -89,10 +93,7 @@ task:

task:
name: "i686: Linux (Debian stable)"
container:
dockerfile: ci/linux-debian.Dockerfile
cpu: 1
memory: 1G
<< : *LINUX_CONTAINER
env:
HOST: i686-linux-gnu
ECDH: yes
@@ -147,8 +148,9 @@ task:
## - rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
##
brew_valgrind_pre_script:
- brew update
- brew config
- brew tap --shallow LouisBrunner/valgrind
- brew tap LouisBrunner/valgrind
# Fetch valgrind source but don't build it yet.
- brew fetch --HEAD LouisBrunner/valgrind/valgrind
brew_valgrind_cache:
@@ -178,13 +180,10 @@ task:

task:
name: "s390x (big-endian): Linux (Debian stable, QEMU)"
container:
dockerfile: ci/linux-debian.Dockerfile
cpu: 1
memory: 1G
<< : *LINUX_CONTAINER
env:
WRAPPER_CMD: qemu-s390x
TEST_ITERS: 16
SECP256K1_TEST_ITERS: 16
HOST: s390x-linux-gnu
WITH_VALGRIND: no
ECDH: yes
@@ -207,13 +206,10 @@ task:

task:
name: "ARM32: Linux (Debian stable, QEMU)"
container:
dockerfile: ci/linux-debian.Dockerfile
cpu: 1
memory: 1G
<< : *LINUX_CONTAINER
env:
WRAPPER_CMD: qemu-arm
TEST_ITERS: 16
SECP256K1_TEST_ITERS: 16
HOST: arm-linux-gnueabihf
WITH_VALGRIND: no
ECDH: yes
@@ -231,13 +227,10 @@ task:

task:
name: "ARM64: Linux (Debian stable, QEMU)"
container:
dockerfile: ci/linux-debian.Dockerfile
cpu: 1
memory: 1G
<< : *LINUX_CONTAINER
env:
WRAPPER_CMD: qemu-aarch64
TEST_ITERS: 16
SECP256K1_TEST_ITERS: 16
HOST: aarch64-linux-gnu
WITH_VALGRIND: no
ECDH: yes
@@ -252,13 +245,10 @@ task:

task:
name: "ppc64le: Linux (Debian stable, QEMU)"
container:
dockerfile: ci/linux-debian.Dockerfile
cpu: 1
memory: 1G
<< : *LINUX_CONTAINER
env:
WRAPPER_CMD: qemu-ppc64le
TEST_ITERS: 16
SECP256K1_TEST_ITERS: 16
HOST: powerpc64le-linux-gnu
WITH_VALGRIND: no
ECDH: yes
@@ -273,13 +263,10 @@ task:

task:
name: "x86_64 (mingw32-w64): Windows (Debian stable, Wine)"
container:
dockerfile: ci/linux-debian.Dockerfile
cpu: 1
memory: 1G
<< : *LINUX_CONTAINER
env:
WRAPPER_CMD: wine64-stable
TEST_ITERS: 16
SECP256K1_TEST_ITERS: 16
HOST: x86_64-w64-mingw32
WITH_VALGRIND: no
ECDH: yes
@@ -295,10 +282,7 @@ task:
# Sanitizers
task:
timeout_in: 120m
container:
dockerfile: ci/linux-debian.Dockerfile
cpu: 1
memory: 2G
<< : *LINUX_CONTAINER
env:
ECDH: yes
RECOVERY: yes
@@ -311,30 +295,31 @@ task:
MUSIG: yes
ECDSAADAPTOR: yes
CTIMETEST: no
EXTRAFLAGS: "--disable-openssl-tests"
matrix:
- name: "Valgrind (memcheck)"
container:
cpu: 2
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
SECP256K1_TEST_ITERS: 2
- name: "UBSan, ASan, LSan"
container:
memory: 2G
env:
CFLAGS: "-fsanitize=undefined,address"
CFLAGS_FOR_BUILD: "-fsanitize=undefined,address"
CFLAGS: "-fsanitize=undefined,address -g"
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
SECP256K1_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
ECMULTWINDOW: 2
matrix:
- env:
CC: clang
@@ -348,15 +333,12 @@ task:

task:
name: "C++ -fpermissive"
container:
dockerfile: ci/linux-debian.Dockerfile
cpu: 1
memory: 1G
<< : *LINUX_CONTAINER
env:
# ./configure correctly errors out when given CC=g++.
# We hack around this by passing CC=g++ only to make.
CC: gcc
MAKEFLAGS: -j2 CC=g++ CFLAGS=-fpermissive
MAKEFLAGS: -j4 CC=g++ CFLAGS=-fpermissive\ -g
WERROR_CFLAGS:
EXPERIMENTAL: yes
ECDH: yes
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
src/ecmult_static_pre_g.h linguist-generated
src/precomputed_ecmult.c linguist-generated
src/precomputed_ecmult_gen.c linguist-generated
13 changes: 4 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
bench_inv
bench_ecdh
bench
bench_ecmult
bench_generator
bench_rangeproof
bench_schnorrsig
bench_sign
bench_verify
bench_recover
bench_internal
tests
exhaustive_tests
gen_context
gen_ecmult_static_pre_g
precompute_ecmult_gen
precompute_ecmult
valgrind_ctime_test
*.exe
*.so
*.a
*.csv
!.gitignore

Makefile
@@ -47,7 +43,6 @@ coverage.*.html

src/libsecp256k1-config.h
src/libsecp256k1-config.h.in
src/ecmult_static_context.h
build-aux/config.guess
build-aux/config.sub
build-aux/depcomp
Loading