Skip to content

Commit 2619657

Browse files
committed
Update secp256k1 subtree to latest upstream master
2 parents 41720a1 + afb7a6f commit 2619657

Some content is hidden

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

55 files changed

+2451
-976
lines changed

src/secp256k1/.cirrus.yml

Lines changed: 42 additions & 56 deletions
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,28 +52,32 @@ 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}
63-
- env: {WIDEMUL: int64, ECDH: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
70+
- env: {WIDEMUL: int64, ECDH: yes, SCHNORRSIG: yes}
6471
- env: {WIDEMUL: int128}
65-
- env: {WIDEMUL: int128, RECOVERY: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
66-
- env: {WIDEMUL: int128, ECDH: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
72+
- env: {WIDEMUL: int128, RECOVERY: yes, SCHNORRSIG: yes}
73+
- env: {WIDEMUL: int128, ECDH: yes, SCHNORRSIG: yes}
6774
- env: {WIDEMUL: int128, ASM: x86_64}
68-
- env: { RECOVERY: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
69-
- env: { STATICPRECOMPUTATION: no}
75+
- env: { RECOVERY: yes, SCHNORRSIG: yes}
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,15 +90,11 @@ 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
9497
RECOVERY: yes
95-
EXPERIMENTAL: yes
9698
SCHNORRSIG: yes
9799
matrix:
98100
- env:
@@ -134,8 +136,10 @@ task:
134136
## - rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
135137
##
136138
brew_valgrind_pre_script:
139+
# Retry a few times because this tends to fail randomly.
140+
- for i in {1..5}; do brew update && break || sleep 15; done
137141
- brew config
138-
- brew tap --shallow LouisBrunner/valgrind
142+
- brew tap LouisBrunner/valgrind
139143
# Fetch valgrind source but don't build it yet.
140144
- brew fetch --HEAD LouisBrunner/valgrind/valgrind
141145
brew_valgrind_cache:
@@ -165,18 +169,14 @@ task:
165169

166170
task:
167171
name: "s390x (big-endian): Linux (Debian stable, QEMU)"
168-
container:
169-
dockerfile: ci/linux-debian.Dockerfile
170-
cpu: 1
171-
memory: 1G
172+
<< : *LINUX_CONTAINER
172173
env:
173174
WRAPPER_CMD: qemu-s390x
174175
SECP256K1_TEST_ITERS: 16
175176
HOST: s390x-linux-gnu
176177
WITH_VALGRIND: no
177178
ECDH: yes
178179
RECOVERY: yes
179-
EXPERIMENTAL: yes
180180
SCHNORRSIG: yes
181181
CTIMETEST: no
182182
<< : *MERGE_BASE
@@ -188,42 +188,34 @@ task:
188188

189189
task:
190190
name: "ARM32: Linux (Debian stable, QEMU)"
191-
container:
192-
dockerfile: ci/linux-debian.Dockerfile
193-
cpu: 1
194-
memory: 1G
191+
<< : *LINUX_CONTAINER
195192
env:
196193
WRAPPER_CMD: qemu-arm
197194
SECP256K1_TEST_ITERS: 16
198195
HOST: arm-linux-gnueabihf
199196
WITH_VALGRIND: no
200197
ECDH: yes
201198
RECOVERY: yes
202-
EXPERIMENTAL: yes
203199
SCHNORRSIG: yes
204200
CTIMETEST: no
205201
matrix:
206202
- env: {}
207-
- env: {ASM: arm}
203+
- env: {EXPERIMENTAL: yes, ASM: arm}
208204
<< : *MERGE_BASE
209205
test_script:
210206
- ./ci/cirrus.sh
211207
<< : *CAT_LOGS
212208

213209
task:
214210
name: "ARM64: Linux (Debian stable, QEMU)"
215-
container:
216-
dockerfile: ci/linux-debian.Dockerfile
217-
cpu: 1
218-
memory: 1G
211+
<< : *LINUX_CONTAINER
219212
env:
220213
WRAPPER_CMD: qemu-aarch64
221214
SECP256K1_TEST_ITERS: 16
222215
HOST: aarch64-linux-gnu
223216
WITH_VALGRIND: no
224217
ECDH: yes
225218
RECOVERY: yes
226-
EXPERIMENTAL: yes
227219
SCHNORRSIG: yes
228220
CTIMETEST: no
229221
<< : *MERGE_BASE
@@ -233,18 +225,14 @@ task:
233225

234226
task:
235227
name: "ppc64le: Linux (Debian stable, QEMU)"
236-
container:
237-
dockerfile: ci/linux-debian.Dockerfile
238-
cpu: 1
239-
memory: 1G
228+
<< : *LINUX_CONTAINER
240229
env:
241230
WRAPPER_CMD: qemu-ppc64le
242231
SECP256K1_TEST_ITERS: 16
243232
HOST: powerpc64le-linux-gnu
244233
WITH_VALGRIND: no
245234
ECDH: yes
246235
RECOVERY: yes
247-
EXPERIMENTAL: yes
248236
SCHNORRSIG: yes
249237
CTIMETEST: no
250238
<< : *MERGE_BASE
@@ -254,18 +242,14 @@ task:
254242

255243
task:
256244
name: "x86_64 (mingw32-w64): Windows (Debian stable, Wine)"
257-
container:
258-
dockerfile: ci/linux-debian.Dockerfile
259-
cpu: 1
260-
memory: 1G
245+
<< : *LINUX_CONTAINER
261246
env:
262247
WRAPPER_CMD: wine64-stable
263248
SECP256K1_TEST_ITERS: 16
264249
HOST: x86_64-w64-mingw32
265250
WITH_VALGRIND: no
266251
ECDH: yes
267252
RECOVERY: yes
268-
EXPERIMENTAL: yes
269253
SCHNORRSIG: yes
270254
CTIMETEST: no
271255
<< : *MERGE_BASE
@@ -275,23 +259,23 @@ task:
275259

276260
# Sanitizers
277261
task:
278-
container:
279-
dockerfile: ci/linux-debian.Dockerfile
280-
cpu: 1
281-
memory: 2G
262+
<< : *LINUX_CONTAINER
282263
env:
283264
ECDH: yes
284265
RECOVERY: yes
285-
EXPERIMENTAL: yes
286266
SCHNORRSIG: yes
287267
CTIMETEST: no
288268
matrix:
289269
- name: "Valgrind (memcheck)"
270+
container:
271+
cpu: 2
290272
env:
291273
# 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)
292274
WRAPPER_CMD: "valgrind --error-exitcode=42"
293275
SECP256K1_TEST_ITERS: 2
294276
- name: "UBSan, ASan, LSan"
277+
container:
278+
memory: 2G
295279
env:
296280
CFLAGS: "-fsanitize=undefined,address -g"
297281
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
@@ -302,11 +286,10 @@ task:
302286
matrix:
303287
- env:
304288
ASM: auto
305-
STATICPRECOMPUTATION: yes
306289
- env:
307290
ASM: no
308-
STATICPRECOMPUTATION: no
309291
ECMULTGENPRECISION: 2
292+
ECMULTWINDOW: 2
310293
matrix:
311294
- env:
312295
CC: clang
@@ -320,21 +303,24 @@ task:
320303

321304
task:
322305
name: "C++ -fpermissive"
323-
container:
324-
dockerfile: ci/linux-debian.Dockerfile
325-
cpu: 1
326-
memory: 1G
306+
<< : *LINUX_CONTAINER
327307
env:
328308
# ./configure correctly errors out when given CC=g++.
329309
# We hack around this by passing CC=g++ only to make.
330310
CC: gcc
331-
MAKEFLAGS: -j2 CC=g++ CFLAGS=-fpermissive\ -g
311+
MAKEFLAGS: -j4 CC=g++ CFLAGS=-fpermissive\ -g
332312
WERROR_CFLAGS:
333-
EXPERIMENTAL: yes
334313
ECDH: yes
335314
RECOVERY: yes
336315
SCHNORRSIG: yes
337316
<< : *MERGE_BASE
338317
test_script:
339318
- ./ci/cirrus.sh
340319
<< : *CAT_LOGS
320+
321+
task:
322+
name: "sage prover"
323+
<< : *LINUX_CONTAINER
324+
test_script:
325+
- cd sage
326+
- sage prove_group_implementations.sage

src/secp256k1/.gitattributes

Lines changed: 2 additions & 2 deletions
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

src/secp256k1/.gitignore

Lines changed: 8 additions & 2 deletions
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)