Skip to content

Commit 8f8631d

Browse files
committed
Squashed 'src/secp256k1/' changes from 0559fc6..0e5cbd0
0e5cbd0 Merge bitcoin-core/secp256k1#1088: configure: Use modern way to set AR 0d253d5 configure: Use modern way to set AR ac83be3 Merge bitcoin-core/secp256k1#1079: configure: Add hidden --enable-dev-mode to enable all the stuff e0838d6 configure: Add hidden --enable-dev-mode to enable all the stuff fabd579 configure: Remove redundant code that sets _enable variables 0d4226c configure: Use canonical variable prefix _enable consistently 64b3497 Merge bitcoin-core/secp256k1#748: Add usage examples 7c9502c Add a copy of the CC0 license to the examples 42e0343 Add usage examples to the readme 517644e Optionally compile the examples in autotools, compile+run in travis 422a7cc Add a ecdh shared secret example b0cfbcc Add a Schnorr signing and verifying example fee7d4b Add an ECDSA signing and verifying example 1253a27 Merge bitcoin-core/secp256k1#1033: Add _fe_half and use in _gej_add_ge and _gej_double 3ef94aa Merge bitcoin-core/secp256k1#1026: ecdh: Add test computing shared_secret=basepoint with random inputs 3531a43 ecdh: Make generator_basepoint test depend on global iteration count c881dd4 ecdh: Add test computing shared_secret=basepoint with random inputs 0775283 Merge bitcoin-core/secp256k1#1074: ci: Retry brew update a few times to avoid random failures e51ad3b ci: Retry `brew update` a few times to avoid random failures b1cb969 ci: Revert "Attempt to make macOS builds more reliable" 5dcc6f8 Merge bitcoin-core/secp256k1#1069: build: Replace use of deprecated autoconf macro AC_PROG_CC_C89 5954794 Merge bitcoin-core/secp256k1#1072: ci: Attempt to make macOS builds more reliable 85b00a1 Merge bitcoin-core/secp256k1#1068: sage: Fix incompatibility with sage 9.4 ebb1bee sage: Ensure that constraints are always fastfracs d8d5485 ci: Run sage prover on CI 77cfa98 sage: Normalize sign of polynomial factors in prover eae7586 sage: Exit with non-zero status in case of failures d9396a5 ci: Attempt to make macOS builds more reliable e0db3f8 build: Replace use of deprecated autoconf macro AC_PROG_CC_C89 e848c37 Update sage files for new formulae d64bb5d Add fe_half tests for worst-case inputs b54d843 sage: Fix printing of errors 4eb8b93 Further improve doubling formula using fe_half 557b31f Doubling formula using fe_half 2cbb4b1 Run more iterations of run_field_misc 9cc5c25 Add test for secp256k1_fe_half 925f78d Add _fe_half and use in _gej_add_ge e108d00 sage: Fix incompatibility with sage 9.4 d8a2463 Merge bitcoin-core/secp256k1#899: Reduce stratch space needed by ecmult_strauss_wnaf. 0a40a48 Merge bitcoin-core/secp256k1#1049: Faster fixed-input ecmult tests 070e772 Faster fixed-input ecmult tests c8aa516 Merge bitcoin-core/secp256k1#1064: Modulo-reduce msg32 inside RFC6979 nonce fn to match spec. Fixes bitcoin#1063 b797a50 Create a SECP256K1_ECMULT_TABLE_VERIFY macro. a731200 Replace ECMULT_TABLE_GET_GE_STORAGE macro with a function. fe34d9f Eliminate input_pos state field from ecmult_strauss_wnaf. 0397d00 Eliminate na_1 and na_lam state fields from ecmult_strauss_wnaf. 7ba3ffc Remove the unused pre_a_lam allocations. b3b57ad Eliminate the pre_a_lam array from ecmult_strauss_wnaf. ae7ba0f Remove the unused prej allocations. e5c1889 Eliminate the prej array from ecmult_strauss_wnaf. c9da1ba Move secp256k1_fe_one to field.h 45f37b6 Modulo-reduce msg32 inside RFC6979 nonce fn to match spec. Fixes bitcoin#1063. a1102b1 Merge bitcoin-core/secp256k1#1029: Simpler and faster ecdh skew fixup e82144e Fixup skew before global Z fixup 40b624c Add tests for _gej_cmov 8c13a9b ECDH skews by 0 or 1 1515099 Simpler and faster ecdh skew fixup 39a36db Merge bitcoin-core/secp256k1#1054: tests: Fix test whose result is implementation-defined a310e79 Merge bitcoin-core/secp256k1#1052: Use xoshiro256++ instead of RFC6979 for tests 423b6d1 Merge bitcoin-core/secp256k1#964: Add release-process.md 9281c9f Merge bitcoin-core/secp256k1#1053: ecmult: move `_ecmult_odd_multiples_table_globalz_windowa` 77a1975 Use xoshiro256++ PRNG instead of RFC6979 in tests 5f2efe6 secp256k1_testrand_int(2**N) -> secp256k1_testrand_bits(N) 05e049b ecmult: move `_ecmult_odd_multiples_table_globalz_windowa` 3d7cbaf tests: Fix test whose result is implementation-defined 3ed0d02 doc: add CHANGELOG template 6f42dc1 doc: add release_process.md 0bd3e42 build: set library version to 0.0.0 explicitly b4b02fd build: change libsecp version from 0.1 to 0.1.0-pre 09971a3 Merge bitcoin-core/secp256k1#1047: ci: Various improvements 0b83b20 Merge bitcoin-core/secp256k1#1030: doc: Fix upper bounds + cleanup in field_5x52_impl.h comment 1287786 doc: Add comment to top of field_10x26_impl.h 58da5bd doc: Fix upper bounds + cleanup in field_5x52_impl.h comment b39d431 Merge bitcoin-core/secp256k1#1044: Add another ecmult_multi test b4ac1a1 ci: Run valgrind/memcheck tasks with 2 CPUs e70acab ci: Use Cirrus "greedy" flag to use idle CPU time when available d07e301 ci: Update brew on macOS 22382f0 ci: Test different ecmult window sizes a69df3a Merge bitcoin-core/secp256k1#816: Improve checks at top of _fe_negate methods 22d25c8 Add another ecmult_multi test 515e795 Improve checks at top of _fe_negate methods 26a022a ci: Remove STATICPRECOMPUTATION 10461d8 precompute_ecmult: Always compute all tables up to default WINDOW_G be6944a Merge bitcoin-core/secp256k1#1042: Follow-ups to making all tables fully static e05da9e Fix c++ build c45386d Cleanup preprocessor indentation in precompute{,d}_ecmult{,_gen} 19d96e1 Split off .c file from precomputed_ecmult.h 1a6691a Split off .c file from precomputed_ecmult_gen.h bb36331 Simplify precompute_ecmult_print_* 38cd84a Compute ecmult tables at runtime for tests_exhaustive e458ec2 Move ecmult table computation code to separate file fc1bf9f Split ecmult table computation and printing 31feab0 Rename function secp256k1_ecmult_gen_{create_prec -> compute}_table 725370c Rename ecmult_gen_prec -> ecmult_gen_compute_table 075252c Rename ecmult_static_pre_g -> precomputed_ecmult 7cf47f7 Rename ecmult_gen_static_prec_table -> precomputed_ecmult_gen f95b810 Rename gen_ecmult_static_pre_g -> precompute_ecmult bae7768 Rename gen_ecmult_gen_static_prec_table -> precompute_ecmult_gen git-subtree-dir: src/secp256k1 git-subtree-split: 0e5cbd0
1 parent 86dbc4d commit 8f8631d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2173
-845
lines changed

.cirrus.yml

+37-43
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ env:
44
# Specific warnings can be disabled with -Wno-error=foo.
55
# -pedantic-errors is not equivalent to -Werror=pedantic and thus not implied by -Werror according to the GCC manual.
66
WERROR_CFLAGS: -Werror -pedantic-errors
7-
MAKEFLAGS: -j2
7+
MAKEFLAGS: -j4
88
BUILD: check
99
### secp256k1 config
10-
STATICPRECOMPUTATION: yes
10+
ECMULTWINDOW: auto
1111
ECMULTGENPRECISION: auto
1212
ASM: no
1313
WIDEMUL: auto
@@ -23,6 +23,8 @@ env:
2323
BENCH: yes
2424
SECP256K1_BENCH_ITERS: 2
2525
CTIMETEST: yes
26+
# Compile and run the tests
27+
EXAMPLES: yes
2628

2729
cat_logs_snippet: &CAT_LOGS
2830
always:
@@ -50,14 +52,19 @@ merge_base_script_snippet: &MERGE_BASE
5052
- git config --global user.name "ci"
5153
- git merge FETCH_HEAD # Merge base to detect silent merge conflicts
5254

53-
task:
54-
name: "x86_64: Linux (Debian stable)"
55+
linux_container_snippet: &LINUX_CONTAINER
5556
container:
5657
dockerfile: ci/linux-debian.Dockerfile
5758
# Reduce number of CPUs to be able to do more builds in parallel.
5859
cpu: 1
60+
# Gives us more CPUs for free if they're available.
61+
greedy: true
5962
# More than enough for our scripts.
6063
memory: 1G
64+
65+
task:
66+
name: "x86_64: Linux (Debian stable)"
67+
<< : *LINUX_CONTAINER
6168
matrix: &ENV_MATRIX
6269
- env: {WIDEMUL: int64, RECOVERY: yes}
6370
- env: {WIDEMUL: int64, ECDH: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
@@ -66,12 +73,11 @@ task:
6673
- env: {WIDEMUL: int128, ECDH: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
6774
- env: {WIDEMUL: int128, ASM: x86_64}
6875
- env: { RECOVERY: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
69-
- env: { STATICPRECOMPUTATION: no}
7076
- env: {BUILD: distcheck, WITH_VALGRIND: no, CTIMETEST: no, BENCH: no}
7177
- env: {CPPFLAGS: -DDETERMINISTIC}
7278
- env: {CFLAGS: -O0, CTIMETEST: no}
73-
- env: { ECMULTGENPRECISION: 2 }
74-
- env: { ECMULTGENPRECISION: 8 }
79+
- env: { ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
80+
- env: { ECMULTGENPRECISION: 8, ECMULTWINDOW: 4 }
7581
matrix:
7682
- env:
7783
CC: gcc
@@ -84,10 +90,7 @@ task:
8490

8591
task:
8692
name: "i686: Linux (Debian stable)"
87-
container:
88-
dockerfile: ci/linux-debian.Dockerfile
89-
cpu: 1
90-
memory: 1G
93+
<< : *LINUX_CONTAINER
9194
env:
9295
HOST: i686-linux-gnu
9396
ECDH: yes
@@ -134,8 +137,10 @@ task:
134137
## - rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
135138
##
136139
brew_valgrind_pre_script:
140+
# Retry a few times because this tends to fail randomly.
141+
- for i in {1..5}; do brew update && break || sleep 15; done
137142
- brew config
138-
- brew tap --shallow LouisBrunner/valgrind
143+
- brew tap LouisBrunner/valgrind
139144
# Fetch valgrind source but don't build it yet.
140145
- brew fetch --HEAD LouisBrunner/valgrind/valgrind
141146
brew_valgrind_cache:
@@ -165,10 +170,7 @@ task:
165170

166171
task:
167172
name: "s390x (big-endian): Linux (Debian stable, QEMU)"
168-
container:
169-
dockerfile: ci/linux-debian.Dockerfile
170-
cpu: 1
171-
memory: 1G
173+
<< : *LINUX_CONTAINER
172174
env:
173175
WRAPPER_CMD: qemu-s390x
174176
SECP256K1_TEST_ITERS: 16
@@ -188,10 +190,7 @@ task:
188190

189191
task:
190192
name: "ARM32: Linux (Debian stable, QEMU)"
191-
container:
192-
dockerfile: ci/linux-debian.Dockerfile
193-
cpu: 1
194-
memory: 1G
193+
<< : *LINUX_CONTAINER
195194
env:
196195
WRAPPER_CMD: qemu-arm
197196
SECP256K1_TEST_ITERS: 16
@@ -212,10 +211,7 @@ task:
212211

213212
task:
214213
name: "ARM64: Linux (Debian stable, QEMU)"
215-
container:
216-
dockerfile: ci/linux-debian.Dockerfile
217-
cpu: 1
218-
memory: 1G
214+
<< : *LINUX_CONTAINER
219215
env:
220216
WRAPPER_CMD: qemu-aarch64
221217
SECP256K1_TEST_ITERS: 16
@@ -233,10 +229,7 @@ task:
233229

234230
task:
235231
name: "ppc64le: Linux (Debian stable, QEMU)"
236-
container:
237-
dockerfile: ci/linux-debian.Dockerfile
238-
cpu: 1
239-
memory: 1G
232+
<< : *LINUX_CONTAINER
240233
env:
241234
WRAPPER_CMD: qemu-ppc64le
242235
SECP256K1_TEST_ITERS: 16
@@ -254,10 +247,7 @@ task:
254247

255248
task:
256249
name: "x86_64 (mingw32-w64): Windows (Debian stable, Wine)"
257-
container:
258-
dockerfile: ci/linux-debian.Dockerfile
259-
cpu: 1
260-
memory: 1G
250+
<< : *LINUX_CONTAINER
261251
env:
262252
WRAPPER_CMD: wine64-stable
263253
SECP256K1_TEST_ITERS: 16
@@ -275,10 +265,7 @@ task:
275265

276266
# Sanitizers
277267
task:
278-
container:
279-
dockerfile: ci/linux-debian.Dockerfile
280-
cpu: 1
281-
memory: 2G
268+
<< : *LINUX_CONTAINER
282269
env:
283270
ECDH: yes
284271
RECOVERY: yes
@@ -287,11 +274,15 @@ task:
287274
CTIMETEST: no
288275
matrix:
289276
- name: "Valgrind (memcheck)"
277+
container:
278+
cpu: 2
290279
env:
291280
# 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)
292281
WRAPPER_CMD: "valgrind --error-exitcode=42"
293282
SECP256K1_TEST_ITERS: 2
294283
- name: "UBSan, ASan, LSan"
284+
container:
285+
memory: 2G
295286
env:
296287
CFLAGS: "-fsanitize=undefined,address -g"
297288
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
@@ -302,11 +293,10 @@ task:
302293
matrix:
303294
- env:
304295
ASM: auto
305-
STATICPRECOMPUTATION: yes
306296
- env:
307297
ASM: no
308-
STATICPRECOMPUTATION: no
309298
ECMULTGENPRECISION: 2
299+
ECMULTWINDOW: 2
310300
matrix:
311301
- env:
312302
CC: clang
@@ -320,15 +310,12 @@ task:
320310

321311
task:
322312
name: "C++ -fpermissive"
323-
container:
324-
dockerfile: ci/linux-debian.Dockerfile
325-
cpu: 1
326-
memory: 1G
313+
<< : *LINUX_CONTAINER
327314
env:
328315
# ./configure correctly errors out when given CC=g++.
329316
# We hack around this by passing CC=g++ only to make.
330317
CC: gcc
331-
MAKEFLAGS: -j2 CC=g++ CFLAGS=-fpermissive\ -g
318+
MAKEFLAGS: -j4 CC=g++ CFLAGS=-fpermissive\ -g
332319
WERROR_CFLAGS:
333320
EXPERIMENTAL: yes
334321
ECDH: yes
@@ -338,3 +325,10 @@ task:
338325
test_script:
339326
- ./ci/cirrus.sh
340327
<< : *CAT_LOGS
328+
329+
task:
330+
name: "sage prover"
331+
<< : *LINUX_CONTAINER
332+
test_script:
333+
- cd sage
334+
- sage prove_group_implementations.sage

.gitattributes

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
src/ecmult_static_pre_g.h linguist-generated
2-
src/ecmult_gen_static_prec_table.h linguist-generated
1+
src/precomputed_ecmult.c linguist-generated
2+
src/precomputed_ecmult_gen.c linguist-generated

.gitignore

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@ bench_ecmult
33
bench_internal
44
tests
55
exhaustive_tests
6-
gen_ecmult_gen_static_prec_table
7-
gen_ecmult_static_pre_g
6+
precompute_ecmult_gen
7+
precompute_ecmult
88
valgrind_ctime_test
9+
ecdh_example
10+
ecdsa_example
11+
schnorr_example
912
*.exe
1013
*.so
1114
*.a
1215
*.csv
1316
!.gitignore
17+
*.log
18+
*.trs
1419

1520
Makefile
1621
configure
@@ -41,6 +46,7 @@ coverage.*.html
4146

4247
src/libsecp256k1-config.h
4348
src/libsecp256k1-config.h.in
49+
build-aux/ar-lib
4450
build-aux/config.guess
4551
build-aux/config.sub
4652
build-aux/depcomp

0 commit comments

Comments
 (0)