Skip to content

Commit 50b7c25

Browse files
committed
Merge #384: update libsecp to latest ersion; bump major version number
aa51638 update changelog for 0.22.0 (Andrew Poelstra) d06dd20 update fuzzdummy API to match normal API (Andrew Poelstra) f3d48a2 update "should terminate abnormally" test to trigger a different ARG_CHECK (Andrew Poelstra) 8294ea3 secp256k1-sys: update upstream library (Andrew Poelstra) 2932179 secp256k1-sys: update secp256k1.h.patch (Andrew Poelstra) Pull request description: Should wait on merging until we get a minor release out with #382 and #376. May also want to bundle #380 with this? ACKs for top commit: real-or-random: ACK aa51638 I can't judge if the feature set is meaningful but this release PR is fine Tree-SHA512: e7f48b402378e280a034127f2de58d3127e04303a114f07f294fa3d00c0a083ae0d43375a8a74d226b13ea45fb3fde07d8450790e602bbf9581adc5fd8bc7d29
2 parents 69bbe85 + aa51638 commit 50b7c25

File tree

122 files changed

+34009
-7376
lines changed

Some content is hidden

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

122 files changed

+34009
-7376
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 0.22.0 - 2022-03-08
2+
3+
* Disable `bitcoin_hashes/std` by default; [add `bitcoin-hashes-std` feature to re-enable it](https://github.com/rust-bitcoin/rust-secp256k1/pull/410)
4+
* Rename [more `schnorrsig` methods to `schnorr`](https://github.com/rust-bitcoin/rust-secp256k1/pull/411)
5+
* [Obfuscate `SharedSecret` string serialization](https://github.com/rust-bitcoin/rust-secp256k1/pull/396)
6+
* [Simplify `SharedSecret` API](https://github.com/rust-bitcoin/rust-secp256k1/pull/402) to use a 32-byte buffer; users of custom hashes should now use bare arrays rather than this type.
7+
* Change [serde serialization of `Parity`](https://github.com/rust-bitcoin/rust-secp256k1/pull/401) from `i32` to `u8`; clean up [error handling](https://github.com/rust-bitcoin/rust-secp256k1/pull/403)
8+
19
# 0.21.3 - 2022-01-31
210

311
* Several documentation improvements ([#366](https://github.com/rust-bitcoin/rust-secp256k1/pull/366), [#365](https://github.com/rust-bitcoin/rust-secp256k1/pull/365), [#373](https://github.com/rust-bitcoin/rust-secp256k1/pull/373), [#381](https://github.com/rust-bitcoin/rust-secp256k1/pull/381), [#369](https://github.com/rust-bitcoin/rust-secp256k1/pull/369), [#389](https://github.com/rust-bitcoin/rust-secp256k1/pull/389), [#391](https://github.com/rust-bitcoin/rust-secp256k1/pull/391), [#397](https://github.com/rust-bitcoin/rust-secp256k1/pull/397), [#399](https://github.com/rust-bitcoin/rust-secp256k1/pull/399), [#340](https://github.com/rust-bitcoin/rust-secp256k1/pull/365))

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.21.3"
3+
version = "0.22.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 = []
3838

3939
[dependencies]
40-
secp256k1-sys = { version = "0.4.2", default-features = false, path = "./secp256k1-sys" }
40+
secp256k1-sys = { version = "0.5.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.4.2"
3+
version = "0.5.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_4_1"
15+
links = "rustsecp256k1_v0_5_0"
1616

1717
# Should make docs.rs show all functions, even those behind non-default features
1818
[package.metadata.docs.rs]

secp256k1-sys/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ fn main() {
5959

6060
// secp256k1
6161
base_config.file("depend/secp256k1/contrib/lax_der_parsing.c")
62+
.file("depend/secp256k1/src/precomputed_ecmult_gen.c")
63+
.file("depend/secp256k1/src/precomputed_ecmult.c")
6264
.file("depend/secp256k1/src/secp256k1.c")
6365
.compile("libsecp256k1.a");
6466
}
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-
1758a92ffd896af533b142707e9892ea6e15e5db
2+
a1102b12196ea27f44d6201de4d25926a2ae9640

secp256k1-sys/depend/secp256k1.h.patch

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
202,204d201
1+
226,228d225
22
< SECP256K1_API secp256k1_context* secp256k1_context_create(
33
< unsigned int flags
44
< ) SECP256K1_WARN_UNUSED_RESULT;
5-
215,217d211
5+
231,233d227
66
< SECP256K1_API secp256k1_context* secp256k1_context_clone(
77
< const secp256k1_context* ctx
88
< ) SECP256K1_ARG_NONNULL(1) SECP256K1_WARN_UNUSED_RESULT;
9-
232,234d225
9+
248,250d241
1010
< SECP256K1_API void secp256k1_context_destroy(
1111
< secp256k1_context* ctx
12-
< );
13-
311,314d301
12+
< ) SECP256K1_ARG_NONNULL(1);
13+
327,330d317
1414
< SECP256K1_API SECP256K1_WARN_UNUSED_RESULT secp256k1_scratch_space* secp256k1_scratch_space_create(
1515
< const secp256k1_context* ctx,
1616
< size_t size
1717
< ) SECP256K1_ARG_NONNULL(1);
18-
322,325d308
18+
338,341d324
1919
< SECP256K1_API void secp256k1_scratch_space_destroy(
2020
< const secp256k1_context* ctx,
2121
< secp256k1_scratch_space* scratch

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

Lines changed: 64 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
env:
2-
WIDEMUL: auto
3-
STATICPRECOMPUTATION: yes
2+
### compiler options
3+
HOST:
4+
# Specific warnings can be disabled with -Wno-error=foo.
5+
# -pedantic-errors is not equivalent to -Werror=pedantic and thus not implied by -Werror according to the GCC manual.
6+
WERROR_CFLAGS: -Werror -pedantic-errors
7+
MAKEFLAGS: -j4
8+
BUILD: check
9+
### secp256k1 config
10+
ECMULTWINDOW: auto
411
ECMULTGENPRECISION: auto
512
ASM: no
6-
BUILD: check
13+
WIDEMUL: auto
714
WITH_VALGRIND: yes
815
EXTRAFLAGS:
9-
HOST:
16+
### secp256k1 modules
17+
EXPERIMENTAL: no
1018
ECDH: no
1119
RECOVERY: no
1220
SCHNORRSIG: no
13-
EXPERIMENTAL: no
14-
CTIMETEST: yes
21+
### test options
22+
SECP256K1_TEST_ITERS:
1523
BENCH: yes
16-
TEST_ITERS:
17-
BENCH_ITERS: 2
18-
MAKEFLAGS: -j2
24+
SECP256K1_BENCH_ITERS: 2
25+
CTIMETEST: yes
1926

2027
cat_logs_snippet: &CAT_LOGS
2128
always:
@@ -43,14 +50,19 @@ merge_base_script_snippet: &MERGE_BASE
4350
- git config --global user.name "ci"
4451
- git merge FETCH_HEAD # Merge base to detect silent merge conflicts
4552

46-
task:
47-
name: "x86_64: Linux (Debian stable)"
53+
linux_container_snippet: &LINUX_CONTAINER
4854
container:
4955
dockerfile: ci/linux-debian.Dockerfile
5056
# Reduce number of CPUs to be able to do more builds in parallel.
5157
cpu: 1
58+
# Gives us more CPUs for free if they're available.
59+
greedy: true
5260
# More than enough for our scripts.
5361
memory: 1G
62+
63+
task:
64+
name: "x86_64: Linux (Debian stable)"
65+
<< : *LINUX_CONTAINER
5466
matrix: &ENV_MATRIX
5567
- env: {WIDEMUL: int64, RECOVERY: yes}
5668
- env: {WIDEMUL: int64, ECDH: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
@@ -59,12 +71,11 @@ task:
5971
- env: {WIDEMUL: int128, ECDH: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
6072
- env: {WIDEMUL: int128, ASM: x86_64}
6173
- env: { RECOVERY: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
62-
- env: { STATICPRECOMPUTATION: no}
6374
- env: {BUILD: distcheck, WITH_VALGRIND: no, CTIMETEST: no, BENCH: no}
6475
- env: {CPPFLAGS: -DDETERMINISTIC}
6576
- env: {CFLAGS: -O0, CTIMETEST: no}
66-
- env: { ECMULTGENPRECISION: 2 }
67-
- env: { ECMULTGENPRECISION: 8 }
77+
- env: { ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
78+
- env: { ECMULTGENPRECISION: 8, ECMULTWINDOW: 4 }
6879
matrix:
6980
- env:
7081
CC: gcc
@@ -77,10 +88,7 @@ task:
7788

7889
task:
7990
name: "i686: Linux (Debian stable)"
80-
container:
81-
dockerfile: ci/linux-debian.Dockerfile
82-
cpu: 1
83-
memory: 1G
91+
<< : *LINUX_CONTAINER
8492
env:
8593
HOST: i686-linux-gnu
8694
ECDH: yes
@@ -127,8 +135,9 @@ task:
127135
## - rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
128136
##
129137
brew_valgrind_pre_script:
138+
- brew update
130139
- brew config
131-
- brew tap --shallow LouisBrunner/valgrind
140+
- brew tap LouisBrunner/valgrind
132141
# Fetch valgrind source but don't build it yet.
133142
- brew fetch --HEAD LouisBrunner/valgrind/valgrind
134143
brew_valgrind_cache:
@@ -158,13 +167,10 @@ task:
158167

159168
task:
160169
name: "s390x (big-endian): Linux (Debian stable, QEMU)"
161-
container:
162-
dockerfile: ci/linux-debian.Dockerfile
163-
cpu: 1
164-
memory: 1G
170+
<< : *LINUX_CONTAINER
165171
env:
166172
WRAPPER_CMD: qemu-s390x
167-
TEST_ITERS: 16
173+
SECP256K1_TEST_ITERS: 16
168174
HOST: s390x-linux-gnu
169175
WITH_VALGRIND: no
170176
ECDH: yes
@@ -181,13 +187,10 @@ task:
181187

182188
task:
183189
name: "ARM32: Linux (Debian stable, QEMU)"
184-
container:
185-
dockerfile: ci/linux-debian.Dockerfile
186-
cpu: 1
187-
memory: 1G
190+
<< : *LINUX_CONTAINER
188191
env:
189192
WRAPPER_CMD: qemu-arm
190-
TEST_ITERS: 16
193+
SECP256K1_TEST_ITERS: 16
191194
HOST: arm-linux-gnueabihf
192195
WITH_VALGRIND: no
193196
ECDH: yes
@@ -205,13 +208,10 @@ task:
205208

206209
task:
207210
name: "ARM64: Linux (Debian stable, QEMU)"
208-
container:
209-
dockerfile: ci/linux-debian.Dockerfile
210-
cpu: 1
211-
memory: 1G
211+
<< : *LINUX_CONTAINER
212212
env:
213213
WRAPPER_CMD: qemu-aarch64
214-
TEST_ITERS: 16
214+
SECP256K1_TEST_ITERS: 16
215215
HOST: aarch64-linux-gnu
216216
WITH_VALGRIND: no
217217
ECDH: yes
@@ -226,13 +226,10 @@ task:
226226

227227
task:
228228
name: "ppc64le: Linux (Debian stable, QEMU)"
229-
container:
230-
dockerfile: ci/linux-debian.Dockerfile
231-
cpu: 1
232-
memory: 1G
229+
<< : *LINUX_CONTAINER
233230
env:
234231
WRAPPER_CMD: qemu-ppc64le
235-
TEST_ITERS: 16
232+
SECP256K1_TEST_ITERS: 16
236233
HOST: powerpc64le-linux-gnu
237234
WITH_VALGRIND: no
238235
ECDH: yes
@@ -247,13 +244,10 @@ task:
247244

248245
task:
249246
name: "x86_64 (mingw32-w64): Windows (Debian stable, Wine)"
250-
container:
251-
dockerfile: ci/linux-debian.Dockerfile
252-
cpu: 1
253-
memory: 1G
247+
<< : *LINUX_CONTAINER
254248
env:
255249
WRAPPER_CMD: wine64-stable
256-
TEST_ITERS: 16
250+
SECP256K1_TEST_ITERS: 16
257251
HOST: x86_64-w64-mingw32
258252
WITH_VALGRIND: no
259253
ECDH: yes
@@ -268,40 +262,38 @@ task:
268262

269263
# Sanitizers
270264
task:
271-
container:
272-
dockerfile: ci/linux-debian.Dockerfile
273-
cpu: 1
274-
memory: 1G
265+
<< : *LINUX_CONTAINER
275266
env:
276267
ECDH: yes
277268
RECOVERY: yes
278269
EXPERIMENTAL: yes
279270
SCHNORRSIG: yes
280271
CTIMETEST: no
281-
EXTRAFLAGS: "--disable-openssl-tests"
282272
matrix:
283273
- name: "Valgrind (memcheck)"
274+
container:
275+
cpu: 2
284276
env:
285277
# 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)
286278
WRAPPER_CMD: "valgrind --error-exitcode=42"
287-
TEST_ITERS: 16
279+
SECP256K1_TEST_ITERS: 2
288280
- name: "UBSan, ASan, LSan"
281+
container:
282+
memory: 2G
289283
env:
290-
CFLAGS: "-fsanitize=undefined,address"
291-
CFLAGS_FOR_BUILD: "-fsanitize=undefined,address"
284+
CFLAGS: "-fsanitize=undefined,address -g"
292285
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
293286
ASAN_OPTIONS: "strict_string_checks=1:detect_stack_use_after_return=1:detect_leaks=1"
294287
LSAN_OPTIONS: "use_unaligned=1"
295-
TEST_ITERS: 32
288+
SECP256K1_TEST_ITERS: 32
296289
# Try to cover many configurations with just a tiny matrix.
297290
matrix:
298291
- env:
299292
ASM: auto
300-
STATICPRECOMPUTATION: yes
301293
- env:
302294
ASM: no
303-
STATICPRECOMPUTATION: no
304295
ECMULTGENPRECISION: 2
296+
ECMULTWINDOW: 2
305297
matrix:
306298
- env:
307299
CC: clang
@@ -313,3 +305,20 @@ task:
313305
- ./ci/cirrus.sh
314306
<< : *CAT_LOGS
315307

308+
task:
309+
name: "C++ -fpermissive"
310+
<< : *LINUX_CONTAINER
311+
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
316+
WERROR_CFLAGS:
317+
EXPERIMENTAL: yes
318+
ECDH: yes
319+
RECOVERY: yes
320+
SCHNORRSIG: yes
321+
<< : *MERGE_BASE
322+
test_script:
323+
- ./ci/cirrus.sh
324+
<< : *CAT_LOGS
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src/precomputed_ecmult.c linguist-generated
2+
src/precomputed_ecmult_gen.c linguist-generated

secp256k1-sys/depend/secp256k1/.gitignore

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
bench_inv
2-
bench_ecdh
1+
bench
32
bench_ecmult
4-
bench_schnorrsig
5-
bench_sign
6-
bench_verify
7-
bench_recover
83
bench_internal
94
tests
105
exhaustive_tests
11-
gen_context
6+
precompute_ecmult_gen
7+
precompute_ecmult
128
valgrind_ctime_test
139
*.exe
1410
*.so
1511
*.a
12+
*.csv
1613
!.gitignore
1714

1815
Makefile
@@ -23,6 +20,7 @@ aclocal.m4
2320
autom4te.cache/
2421
config.log
2522
config.status
23+
conftest*
2624
*.tar.gz
2725
*.la
2826
libtool
@@ -43,7 +41,6 @@ coverage.*.html
4341

4442
src/libsecp256k1-config.h
4543
src/libsecp256k1-config.h.in
46-
src/ecmult_static_context.h
4744
build-aux/config.guess
4845
build-aux/config.sub
4946
build-aux/depcomp

0 commit comments

Comments
 (0)