Skip to content

Commit 5b18493

Browse files
committed
Squashed 'src/secp256k1/' changes from 0559fc6..f997dadf5
f997dadf5 Add ellsq testing to CI ce03649fb Elligator Squared module c9ca664d5 doc: Describe Jacobi calculation in safegcd_implementation.md c880f7613 Native jacobi symbol algorithm 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 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: f997dadf592131054d1cfca6175730e53dee52a1
1 parent 86dbc4d commit 5b18493

Some content is hidden

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

45 files changed

+2016
-592
lines changed

.cirrus.yml

+39-46
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
@@ -18,6 +18,7 @@ env:
1818
ECDH: no
1919
RECOVERY: no
2020
SCHNORRSIG: no
21+
ELLSQ: no
2122
### test options
2223
SECP256K1_TEST_ITERS:
2324
BENCH: yes
@@ -50,28 +51,32 @@ merge_base_script_snippet: &MERGE_BASE
5051
- git config --global user.name "ci"
5152
- git merge FETCH_HEAD # Merge base to detect silent merge conflicts
5253

53-
task:
54-
name: "x86_64: Linux (Debian stable)"
54+
linux_container_snippet: &LINUX_CONTAINER
5555
container:
5656
dockerfile: ci/linux-debian.Dockerfile
5757
# Reduce number of CPUs to be able to do more builds in parallel.
5858
cpu: 1
59+
# Gives us more CPUs for free if they're available.
60+
greedy: true
5961
# More than enough for our scripts.
6062
memory: 1G
63+
64+
task:
65+
name: "x86_64: Linux (Debian stable)"
66+
<< : *LINUX_CONTAINER
6167
matrix: &ENV_MATRIX
6268
- env: {WIDEMUL: int64, RECOVERY: yes}
63-
- env: {WIDEMUL: int64, ECDH: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
69+
- env: {WIDEMUL: int64, ECDH: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes, ELLSQ: yes}
6470
- env: {WIDEMUL: int128}
65-
- env: {WIDEMUL: int128, RECOVERY: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
71+
- env: {WIDEMUL: int128, RECOVERY: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes, ELLSQ: yes}
6672
- env: {WIDEMUL: int128, ECDH: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
6773
- env: {WIDEMUL: int128, ASM: x86_64}
68-
- env: { RECOVERY: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
69-
- env: { STATICPRECOMPUTATION: no}
74+
- env: { RECOVERY: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes, ELLSQ: yes}
7075
- env: {BUILD: distcheck, WITH_VALGRIND: no, CTIMETEST: no, BENCH: no}
7176
- env: {CPPFLAGS: -DDETERMINISTIC}
7277
- env: {CFLAGS: -O0, CTIMETEST: no}
73-
- env: { ECMULTGENPRECISION: 2 }
74-
- env: { ECMULTGENPRECISION: 8 }
78+
- env: { ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
79+
- env: { ECMULTGENPRECISION: 8, ECMULTWINDOW: 4 }
7580
matrix:
7681
- env:
7782
CC: gcc
@@ -84,13 +89,11 @@ task:
8489

8590
task:
8691
name: "i686: Linux (Debian stable)"
87-
container:
88-
dockerfile: ci/linux-debian.Dockerfile
89-
cpu: 1
90-
memory: 1G
92+
<< : *LINUX_CONTAINER
9193
env:
9294
HOST: i686-linux-gnu
9395
ECDH: yes
96+
ELLSQ: yes
9497
RECOVERY: yes
9598
EXPERIMENTAL: yes
9699
SCHNORRSIG: yes
@@ -134,8 +137,9 @@ task:
134137
## - rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
135138
##
136139
brew_valgrind_pre_script:
140+
- brew update
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,16 +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
179+
ELLSQ: yes
178180
RECOVERY: yes
179181
EXPERIMENTAL: yes
180182
SCHNORRSIG: yes
@@ -188,16 +190,14 @@ 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
198197
HOST: arm-linux-gnueabihf
199198
WITH_VALGRIND: no
200199
ECDH: yes
200+
ELLSQ: tes
201201
RECOVERY: yes
202202
EXPERIMENTAL: yes
203203
SCHNORRSIG: yes
@@ -212,16 +212,14 @@ task:
212212

213213
task:
214214
name: "ARM64: Linux (Debian stable, QEMU)"
215-
container:
216-
dockerfile: ci/linux-debian.Dockerfile
217-
cpu: 1
218-
memory: 1G
215+
<< : *LINUX_CONTAINER
219216
env:
220217
WRAPPER_CMD: qemu-aarch64
221218
SECP256K1_TEST_ITERS: 16
222219
HOST: aarch64-linux-gnu
223220
WITH_VALGRIND: no
224221
ECDH: yes
222+
ELLSQ: yes
225223
RECOVERY: yes
226224
EXPERIMENTAL: yes
227225
SCHNORRSIG: yes
@@ -233,16 +231,14 @@ task:
233231

234232
task:
235233
name: "ppc64le: Linux (Debian stable, QEMU)"
236-
container:
237-
dockerfile: ci/linux-debian.Dockerfile
238-
cpu: 1
239-
memory: 1G
234+
<< : *LINUX_CONTAINER
240235
env:
241236
WRAPPER_CMD: qemu-ppc64le
242237
SECP256K1_TEST_ITERS: 16
243238
HOST: powerpc64le-linux-gnu
244239
WITH_VALGRIND: no
245240
ECDH: yes
241+
ELLSQ: yes
246242
RECOVERY: yes
247243
EXPERIMENTAL: yes
248244
SCHNORRSIG: yes
@@ -254,16 +250,14 @@ task:
254250

255251
task:
256252
name: "x86_64 (mingw32-w64): Windows (Debian stable, Wine)"
257-
container:
258-
dockerfile: ci/linux-debian.Dockerfile
259-
cpu: 1
260-
memory: 1G
253+
<< : *LINUX_CONTAINER
261254
env:
262255
WRAPPER_CMD: wine64-stable
263256
SECP256K1_TEST_ITERS: 16
264257
HOST: x86_64-w64-mingw32
265258
WITH_VALGRIND: no
266259
ECDH: yes
260+
ELLSQ: yes
267261
RECOVERY: yes
268262
EXPERIMENTAL: yes
269263
SCHNORRSIG: yes
@@ -275,23 +269,25 @@ task:
275269

276270
# Sanitizers
277271
task:
278-
container:
279-
dockerfile: ci/linux-debian.Dockerfile
280-
cpu: 1
281-
memory: 2G
272+
<< : *LINUX_CONTAINER
282273
env:
283274
ECDH: yes
275+
ELLSQ: yes
284276
RECOVERY: yes
285277
EXPERIMENTAL: yes
286278
SCHNORRSIG: yes
287279
CTIMETEST: no
288280
matrix:
289281
- name: "Valgrind (memcheck)"
282+
container:
283+
cpu: 2
290284
env:
291285
# 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)
292286
WRAPPER_CMD: "valgrind --error-exitcode=42"
293287
SECP256K1_TEST_ITERS: 2
294288
- name: "UBSan, ASan, LSan"
289+
container:
290+
memory: 2G
295291
env:
296292
CFLAGS: "-fsanitize=undefined,address -g"
297293
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
@@ -302,11 +298,10 @@ task:
302298
matrix:
303299
- env:
304300
ASM: auto
305-
STATICPRECOMPUTATION: yes
306301
- env:
307302
ASM: no
308-
STATICPRECOMPUTATION: no
309303
ECMULTGENPRECISION: 2
304+
ECMULTWINDOW: 2
310305
matrix:
311306
- env:
312307
CC: clang
@@ -320,18 +315,16 @@ task:
320315

321316
task:
322317
name: "C++ -fpermissive"
323-
container:
324-
dockerfile: ci/linux-debian.Dockerfile
325-
cpu: 1
326-
memory: 1G
318+
<< : *LINUX_CONTAINER
327319
env:
328320
# ./configure correctly errors out when given CC=g++.
329321
# We hack around this by passing CC=g++ only to make.
330322
CC: gcc
331-
MAKEFLAGS: -j2 CC=g++ CFLAGS=-fpermissive\ -g
323+
MAKEFLAGS: -j4 CC=g++ CFLAGS=-fpermissive\ -g
332324
WERROR_CFLAGS:
333325
EXPERIMENTAL: yes
334326
ECDH: yes
327+
ELLSQ: yes
335328
RECOVERY: yes
336329
SCHNORRSIG: yes
337330
<< : *MERGE_BASE

.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

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ 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
99
*.exe
1010
*.so

0 commit comments

Comments
 (0)