Skip to content

Commit 748dcd9

Browse files
committed
Merge #567: Upgrade the vendored libsecp256k1 code to v0.2.0
2dad589 Upgrade the vendored libsecp256k1 code (Tobin C. Harding) 2d4aacc Update scratch_impl.h patch file (Tobin C. Harding) Pull request description: This bumps `secp256k1` to v0.26.0 and `secp256k1-sys` to v0.8.0 `libsecp256k1` v0.2.0 was just released. Update the vendored code using `./vendor-libsecp.sh depend 0_8_0 21ffe4b` ``` git show 21ffe4b commit 21ffe4b (tag: v0.2.0) Merge: 8c949f5 e025ccd Author: Pieter Wuille <[email protected]> Date: Mon Dec 12 17:00:52 2022 -0500 Merge bitcoin-core/secp256k1#1055: Prepare initial release e025ccd release: prepare for initial release 0.2.0 (Jonas Nick) 6d1784a build: add missing files to EXTRA_DIST (Jonas Nick) 13bf1b6 changelog: make order of change types match keepachangelog.com (Jonas Nick) b1f992a doc: improve release process (Jonas Nick) ad39e2d build: change package version to 0.1.0-dev (Jonas Nick) 90618e9 doc: move CHANGELOG from doc/ to root directory (Jonas Nick) Pull request description: Based on #964 ACKs for top commit: sipa: ACK e025ccd Tree-SHA512: b9ab71d7362537d383a32b5e321ef44069f00e3e92340375bcd662267bc5a60c2bad60222998e6602cfac24ad65efb23d772eac37c86065036b90ef090b54c49 ``` Requires a new version of `secp256k1-sys`, use v0.8.0 - Update the `secp256k1-sys` manifest (including links field) - Update symbols to use 0_8_0 - Add a changelog entry - depend on the new version in `secp256k1` Which in turn requires a new version of `secp256k1`, use v0.26.0 ACKs for top commit: apoelstra: ACK 2dad589 Tree-SHA512: 58eb5a276a78336e45b1473970f2d68dc2249b4a751deae44d70c2453cf5798b0edc0fdee2eabfb5707053e76e3a49849009b0c2f9dce08bd4bb5bb8d3549a62
2 parents 2fccf8d + 2dad589 commit 748dcd9

File tree

126 files changed

+9140
-6757
lines changed

Some content is hidden

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

126 files changed

+9140
-6757
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.26.0 - 2202-12-19
2+
3+
* Update libsecp25k1 to v0.2.0
4+
15
# 0.25.0 - 2022-12-07
26

37
* [Fix soundness issue with `preallocated_gen_new`](https://github.com/rust-bitcoin/rust-secp256k1/pull/548)

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "secp256k1"
3-
version = "0.25.0"
3+
version = "0.26.0"
44
authors = [ "Dawid Ciężarkiewicz <[email protected]>",
55
"Andrew Poelstra <[email protected]>" ]
66
license = "CC0-1.0"
@@ -37,7 +37,7 @@ global-context = ["std"]
3737
global-context-less-secure = ["global-context"]
3838

3939
[dependencies]
40-
secp256k1-sys = { version = "0.7.0", default-features = false, path = "./secp256k1-sys" }
40+
secp256k1-sys = { version = "0.8.0", default-features = false, path = "./secp256k1-sys" }
4141
serde = { version = "1.0", default-features = false, optional = true }
4242

4343
# You likely only want to enable these if you explicitly do not want to use "std", otherwise enable

secp256k1-sys/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "secp256k1-sys"
3-
version = "0.7.0"
3+
version = "0.8.0"
44
authors = [ "Dawid Ciężarkiewicz <[email protected]>",
55
"Andrew Poelstra <[email protected]>",
66
"Steven Roose <[email protected]>" ]
@@ -12,7 +12,7 @@ description = "FFI for Pieter Wuille's `libsecp256k1` library."
1212
keywords = [ "secp256k1", "libsecp256k1", "ffi" ]
1313
readme = "README.md"
1414
build = "build.rs"
15-
links = "rustsecp256k1_v0_7_0"
15+
links = "rustsecp256k1_v0_8_0"
1616
edition = "2018"
1717

1818
# Should make docs.rs show all functions, even those behind non-default features

secp256k1-sys/depend/scratch_impl.h.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
<
1515
< static void secp256k1_scratch_destroy(const secp256k1_callback* error_callback, secp256k1_scratch* scratch) {
1616
< if (scratch != NULL) {
17-
< VERIFY_CHECK(scratch->alloc_size == 0); /* all checkpoints should be applied */
1817
< if (secp256k1_memcmp_var(scratch->magic, "scratch", 8) != 0) {
1918
< secp256k1_callback_call(error_callback, "invalid scratch space");
2019
< return;
2120
< }
21+
< VERIFY_CHECK(scratch->alloc_size == 0); /* all checkpoints should be applied */
2222
< memset(scratch->magic, 0, sizeof(scratch->magic));
2323
< free(scratch);
2424
< }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# This file was automatically created by ./vendor-libsecp.sh
2-
a1102b12196ea27f44d6201de4d25926a2ae9640
2+
21ffe4b22a9683cf24ae0763359e401d1284cc7a

secp256k1-sys/depend/secp256k1/.cirrus.yml

Lines changed: 118 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ env:
2323
BENCH: yes
2424
SECP256K1_BENCH_ITERS: 2
2525
CTIMETEST: yes
26+
# Compile and run the tests
27+
EXAMPLES: yes
28+
29+
# https://cirrus-ci.org/pricing/#compute-credits
30+
credits_snippet: &CREDITS
31+
# Don't use any credits for now.
32+
use_compute_credits: false
2633

2734
cat_logs_snippet: &CAT_LOGS
2835
always:
@@ -34,7 +41,6 @@ cat_logs_snippet: &CAT_LOGS
3441
- cat valgrind_ctime_test.log || true
3542
cat_bench_log_script:
3643
- cat bench.log || true
37-
on_failure:
3844
cat_config_log_script:
3945
- cat config.log || true
4046
cat_test_env_script:
@@ -65,12 +71,13 @@ task:
6571
<< : *LINUX_CONTAINER
6672
matrix: &ENV_MATRIX
6773
- env: {WIDEMUL: int64, RECOVERY: yes}
68-
- env: {WIDEMUL: int64, ECDH: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
74+
- env: {WIDEMUL: int64, ECDH: yes, SCHNORRSIG: yes}
6975
- env: {WIDEMUL: int128}
70-
- env: {WIDEMUL: int128, RECOVERY: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
71-
- env: {WIDEMUL: int128, ECDH: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
76+
- env: {WIDEMUL: int128_struct}
77+
- env: {WIDEMUL: int128, RECOVERY: yes, SCHNORRSIG: yes}
78+
- env: {WIDEMUL: int128, ECDH: yes, SCHNORRSIG: yes}
7279
- env: {WIDEMUL: int128, ASM: x86_64}
73-
- env: { RECOVERY: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
80+
- env: { RECOVERY: yes, SCHNORRSIG: yes}
7481
- env: {BUILD: distcheck, WITH_VALGRIND: no, CTIMETEST: no, BENCH: no}
7582
- env: {CPPFLAGS: -DDETERMINISTIC}
7683
- env: {CFLAGS: -O0, CTIMETEST: no}
@@ -93,7 +100,6 @@ task:
93100
HOST: i686-linux-gnu
94101
ECDH: yes
95102
RECOVERY: yes
96-
EXPERIMENTAL: yes
97103
SCHNORRSIG: yes
98104
matrix:
99105
- env:
@@ -106,64 +112,32 @@ task:
106112
<< : *CAT_LOGS
107113

108114
task:
109-
name: "x86_64: macOS Catalina"
115+
name: "arm64: macOS Ventura"
110116
macos_instance:
111-
image: catalina-base
117+
image: ghcr.io/cirruslabs/macos-ventura-base:latest
112118
env:
113119
HOMEBREW_NO_AUTO_UPDATE: 1
114120
HOMEBREW_NO_INSTALL_CLEANUP: 1
115-
# Cirrus gives us a fixed number of 12 virtual CPUs. Not that we even have that many jobs at the moment...
116-
MAKEFLAGS: -j13
121+
# Cirrus gives us a fixed number of 4 virtual CPUs. Not that we even have that many jobs at the moment...
122+
MAKEFLAGS: -j5
117123
matrix:
118124
<< : *ENV_MATRIX
125+
env:
126+
ASM: no
127+
WITH_VALGRIND: no
128+
CTIMETEST: no
119129
matrix:
120130
- env:
121-
CC: gcc-9
131+
CC: gcc
122132
- env:
123133
CC: clang
124-
# Update Command Line Tools
125-
# Uncomment this if the Command Line Tools on the CirrusCI macOS image are too old to brew valgrind.
126-
# See https://apple.stackexchange.com/a/195963 for the implementation.
127-
## update_clt_script:
128-
## - system_profiler SPSoftwareDataType
129-
## - touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
130-
## - |-
131-
## PROD=$(softwareupdate -l | grep "*.*Command Line" | tail -n 1 | awk -F"*" '{print $2}' | sed -e 's/^ *//' | sed 's/Label: //g' | tr -d '\n')
132-
## # For debugging
133-
## - softwareupdate -l && echo "PROD: $PROD"
134-
## - softwareupdate -i "$PROD" --verbose
135-
## - rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
136-
##
137-
brew_valgrind_pre_script:
138-
- brew update
139-
- brew config
140-
- brew tap LouisBrunner/valgrind
141-
# Fetch valgrind source but don't build it yet.
142-
- brew fetch --HEAD LouisBrunner/valgrind/valgrind
143-
brew_valgrind_cache:
144-
# This is $(brew --cellar valgrind) but command substition does not work here.
145-
folder: /usr/local/Cellar/valgrind
146-
# Rebuild cache if ...
147-
fingerprint_script:
148-
# ... macOS version changes:
149-
- sw_vers
150-
# ... brew changes:
151-
- brew config
152-
# ... valgrind changes:
153-
- git -C "$(brew --cache)/valgrind--git" rev-parse HEAD
154-
populate_script:
155-
# If there's no hit in the cache, build and install valgrind.
156-
- brew install --HEAD LouisBrunner/valgrind/valgrind
157-
brew_valgrind_post_script:
158-
# If we have restored valgrind from the cache, tell brew to create symlink to the PATH.
159-
# If we haven't restored from cached (and just run brew install), this is a no-op.
160-
- brew link valgrind
161134
brew_script:
162-
- brew install automake libtool gcc@9
135+
- brew install automake libtool gcc
163136
<< : *MERGE_BASE
164137
test_script:
165138
- ./ci/cirrus.sh
166139
<< : *CAT_LOGS
140+
<< : *CREDITS
167141

168142
task:
169143
name: "s390x (big-endian): Linux (Debian stable, QEMU)"
@@ -175,7 +149,6 @@ task:
175149
WITH_VALGRIND: no
176150
ECDH: yes
177151
RECOVERY: yes
178-
EXPERIMENTAL: yes
179152
SCHNORRSIG: yes
180153
CTIMETEST: no
181154
<< : *MERGE_BASE
@@ -195,12 +168,11 @@ task:
195168
WITH_VALGRIND: no
196169
ECDH: yes
197170
RECOVERY: yes
198-
EXPERIMENTAL: yes
199171
SCHNORRSIG: yes
200172
CTIMETEST: no
201173
matrix:
202174
- env: {}
203-
- env: {ASM: arm}
175+
- env: {EXPERIMENTAL: yes, ASM: arm}
204176
<< : *MERGE_BASE
205177
test_script:
206178
- ./ci/cirrus.sh
@@ -216,7 +188,6 @@ task:
216188
WITH_VALGRIND: no
217189
ECDH: yes
218190
RECOVERY: yes
219-
EXPERIMENTAL: yes
220191
SCHNORRSIG: yes
221192
CTIMETEST: no
222193
<< : *MERGE_BASE
@@ -234,7 +205,6 @@ task:
234205
WITH_VALGRIND: no
235206
ECDH: yes
236207
RECOVERY: yes
237-
EXPERIMENTAL: yes
238208
SCHNORRSIG: yes
239209
CTIMETEST: no
240210
<< : *MERGE_BASE
@@ -243,18 +213,63 @@ task:
243213
<< : *CAT_LOGS
244214

245215
task:
246-
name: "x86_64 (mingw32-w64): Windows (Debian stable, Wine)"
247216
<< : *LINUX_CONTAINER
248217
env:
249-
WRAPPER_CMD: wine64-stable
250-
SECP256K1_TEST_ITERS: 16
251-
HOST: x86_64-w64-mingw32
218+
WRAPPER_CMD: wine
219+
WITH_VALGRIND: no
220+
ECDH: yes
221+
RECOVERY: yes
222+
SCHNORRSIG: yes
223+
CTIMETEST: no
224+
matrix:
225+
- name: "x86_64 (mingw32-w64): Windows (Debian stable, Wine)"
226+
env:
227+
HOST: x86_64-w64-mingw32
228+
- name: "i686 (mingw32-w64): Windows (Debian stable, Wine)"
229+
env:
230+
HOST: i686-w64-mingw32
231+
<< : *MERGE_BASE
232+
test_script:
233+
- ./ci/cirrus.sh
234+
<< : *CAT_LOGS
235+
236+
task:
237+
<< : *LINUX_CONTAINER
238+
env:
239+
WRAPPER_CMD: wine
240+
WERROR_CFLAGS: -WX
252241
WITH_VALGRIND: no
253242
ECDH: yes
254243
RECOVERY: yes
255244
EXPERIMENTAL: yes
256245
SCHNORRSIG: yes
257246
CTIMETEST: no
247+
# Use a MinGW-w64 host to tell ./configure we're building for Windows.
248+
# This will detect some MinGW-w64 tools but then make will need only
249+
# the MSVC tools CC, AR and NM as specified below.
250+
HOST: x86_64-w64-mingw32
251+
CC: /opt/msvc/bin/x64/cl
252+
AR: /opt/msvc/bin/x64/lib
253+
NM: /opt/msvc/bin/x64/dumpbin -symbols -headers
254+
# Set non-essential options that affect the CLI messages here.
255+
# (They depend on the user's taste, so we don't want to set them automatically in configure.ac.)
256+
CFLAGS: -nologo -diagnostics:caret
257+
LDFLAGS: -XCClinker -nologo -XCClinker -diagnostics:caret
258+
matrix:
259+
- name: "x86_64 (MSVC): Windows (Debian stable, Wine)"
260+
- name: "x86_64 (MSVC): Windows (Debian stable, Wine, int128_struct)"
261+
env:
262+
WIDEMUL: int128_struct
263+
- name: "x86_64 (MSVC): Windows (Debian stable, Wine, int128_struct with __(u)mulh)"
264+
env:
265+
WIDEMUL: int128_struct
266+
CPPFLAGS: -DSECP256K1_MSVC_MULH_TEST_OVERRIDE
267+
- name: "i686 (MSVC): Windows (Debian stable, Wine)"
268+
env:
269+
HOST: i686-w64-mingw32
270+
CC: /opt/msvc/bin/x86/cl
271+
AR: /opt/msvc/bin/x86/lib
272+
NM: /opt/msvc/bin/x86/dumpbin -symbols -headers
258273
<< : *MERGE_BASE
259274
test_script:
260275
- ./ci/cirrus.sh
@@ -266,7 +281,6 @@ task:
266281
env:
267282
ECDH: yes
268283
RECOVERY: yes
269-
EXPERIMENTAL: yes
270284
SCHNORRSIG: yes
271285
CTIMETEST: no
272286
matrix:
@@ -305,20 +319,59 @@ task:
305319
- ./ci/cirrus.sh
306320
<< : *CAT_LOGS
307321

322+
# Memory sanitizers
323+
task:
324+
<< : *LINUX_CONTAINER
325+
name: "MSan"
326+
env:
327+
ECDH: yes
328+
RECOVERY: yes
329+
SCHNORRSIG: yes
330+
CTIMETEST: no
331+
CC: clang
332+
SECP256K1_TEST_ITERS: 32
333+
ASM: no
334+
container:
335+
memory: 2G
336+
matrix:
337+
- env:
338+
CFLAGS: "-fsanitize=memory -g"
339+
- env:
340+
ECMULTGENPRECISION: 2
341+
ECMULTWINDOW: 2
342+
CFLAGS: "-fsanitize=memory -g -O3"
343+
<< : *MERGE_BASE
344+
test_script:
345+
- ./ci/cirrus.sh
346+
<< : *CAT_LOGS
347+
308348
task:
309-
name: "C++ -fpermissive"
349+
name: "C++ -fpermissive (entire project)"
310350
<< : *LINUX_CONTAINER
311351
env:
312-
# ./configure correctly errors out when given CC=g++.
313-
# We hack around this by passing CC=g++ only to make.
314-
CC: gcc
315-
MAKEFLAGS: -j4 CC=g++ CFLAGS=-fpermissive\ -g
352+
CC: g++
353+
CFLAGS: -fpermissive -g
354+
CPPFLAGS: -DSECP256K1_CPLUSPLUS_TEST_OVERRIDE
316355
WERROR_CFLAGS:
317-
EXPERIMENTAL: yes
318356
ECDH: yes
319357
RECOVERY: yes
320358
SCHNORRSIG: yes
321359
<< : *MERGE_BASE
322360
test_script:
323361
- ./ci/cirrus.sh
324362
<< : *CAT_LOGS
363+
364+
task:
365+
name: "C++ (public headers)"
366+
<< : *LINUX_CONTAINER
367+
test_script:
368+
- g++ -Werror include/*.h
369+
- clang -Werror -x c++-header include/*.h
370+
- /opt/msvc/bin/x64/cl.exe -c -WX -TP include/*.h
371+
372+
task:
373+
name: "sage prover"
374+
<< : *LINUX_CONTAINER
375+
test_script:
376+
- cd sage
377+
- sage prove_group_implementations.sage

secp256k1-sys/depend/secp256k1/.gitignore

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@ exhaustive_tests
66
precompute_ecmult_gen
77
precompute_ecmult
88
valgrind_ctime_test
9+
ecdh_example
10+
ecdsa_example
11+
schnorr_example
912
*.exe
1013
*.so
1114
*.a
1215
*.csv
13-
!.gitignore
16+
*.log
17+
*.trs
18+
*.sage.py
1419

1520
Makefile
1621
configure
@@ -29,8 +34,6 @@ libtool
2934
*.lo
3035
*.o
3136
*~
32-
*.log
33-
*.trs
3437

3538
coverage/
3639
coverage.html
@@ -41,6 +44,7 @@ coverage.*.html
4144

4245
src/libsecp256k1-config.h
4346
src/libsecp256k1-config.h.in
47+
build-aux/ar-lib
4448
build-aux/config.guess
4549
build-aux/config.sub
4650
build-aux/depcomp

0 commit comments

Comments
 (0)