Skip to content

Commit 05f4278

Browse files
authored
Merge pull request #306 from LNP-BP/extrakeys/update-1
Extracting SecretKey and uncompressed PublicKey from BIP-350 KeyPair
2 parents a1705e3 + 455ee57 commit 05f4278

File tree

108 files changed

+10094
-7182
lines changed

Some content is hidden

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

108 files changed

+10094
-7182
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ global-context = ["std", "rand-std", "global-context-less-secure"]
2929
global-context-less-secure = []
3030

3131
[dependencies]
32-
secp256k1-sys = { version = "0.4.0", default-features = false, path = "./secp256k1-sys" }
32+
secp256k1-sys = { version = "0.4.1", default-features = false, path = "./secp256k1-sys" }
3333
bitcoin_hashes = { version = "0.9", optional = true }
3434
rand = { version = "0.6", default-features = false, optional = true }
3535
serde = { version = "1.0", default-features = false, optional = true }

secp256k1-sys/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "secp256k1-sys"
3-
version = "0.4.0"
3+
version = "0.4.1"
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_0"
15+
links = "rustsecp256k1_v0_4_1"
1616

1717
# Should make docs.rs show all functions, even those behind non-default features
1818
[package.metadata.docs.rs]
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# This file was automatically created by ./vendor-libsecp.sh
2-
98dac87839838b86094f1bccc71cc20e67b146cc
2+
1758a92ffd896af533b142707e9892ea6e15e5db
+315
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,315 @@
1+
env:
2+
WIDEMUL: auto
3+
STATICPRECOMPUTATION: yes
4+
ECMULTGENPRECISION: auto
5+
ASM: no
6+
BUILD: check
7+
WITH_VALGRIND: yes
8+
EXTRAFLAGS:
9+
HOST:
10+
ECDH: no
11+
RECOVERY: no
12+
SCHNORRSIG: no
13+
EXPERIMENTAL: no
14+
CTIMETEST: yes
15+
BENCH: yes
16+
TEST_ITERS:
17+
BENCH_ITERS: 2
18+
MAKEFLAGS: -j2
19+
20+
cat_logs_snippet: &CAT_LOGS
21+
always:
22+
cat_tests_log_script:
23+
- cat tests.log || true
24+
cat_exhaustive_tests_log_script:
25+
- cat exhaustive_tests.log || true
26+
cat_valgrind_ctime_test_log_script:
27+
- cat valgrind_ctime_test.log || true
28+
cat_bench_log_script:
29+
- cat bench.log || true
30+
on_failure:
31+
cat_config_log_script:
32+
- cat config.log || true
33+
cat_test_env_script:
34+
- cat test_env.log || true
35+
cat_ci_env_script:
36+
- env
37+
38+
merge_base_script_snippet: &MERGE_BASE
39+
merge_base_script:
40+
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
41+
- git fetch $CIRRUS_REPO_CLONE_URL $CIRRUS_BASE_BRANCH
42+
- git config --global user.email "[email protected]"
43+
- git config --global user.name "ci"
44+
- git merge FETCH_HEAD # Merge base to detect silent merge conflicts
45+
46+
task:
47+
name: "x86_64: Linux (Debian stable)"
48+
container:
49+
dockerfile: ci/linux-debian.Dockerfile
50+
# Reduce number of CPUs to be able to do more builds in parallel.
51+
cpu: 1
52+
# More than enough for our scripts.
53+
memory: 1G
54+
matrix: &ENV_MATRIX
55+
- env: {WIDEMUL: int64, RECOVERY: yes}
56+
- env: {WIDEMUL: int64, ECDH: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
57+
- env: {WIDEMUL: int128}
58+
- env: {WIDEMUL: int128, RECOVERY: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
59+
- env: {WIDEMUL: int128, ECDH: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
60+
- env: {WIDEMUL: int128, ASM: x86_64}
61+
- env: { RECOVERY: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
62+
- env: { STATICPRECOMPUTATION: no}
63+
- env: {BUILD: distcheck, WITH_VALGRIND: no, CTIMETEST: no, BENCH: no}
64+
- env: {CPPFLAGS: -DDETERMINISTIC}
65+
- env: {CFLAGS: -O0, CTIMETEST: no}
66+
- env: { ECMULTGENPRECISION: 2 }
67+
- env: { ECMULTGENPRECISION: 8 }
68+
matrix:
69+
- env:
70+
CC: gcc
71+
- env:
72+
CC: clang
73+
<< : *MERGE_BASE
74+
test_script:
75+
- ./ci/cirrus.sh
76+
<< : *CAT_LOGS
77+
78+
task:
79+
name: "i686: Linux (Debian stable)"
80+
container:
81+
dockerfile: ci/linux-debian.Dockerfile
82+
cpu: 1
83+
memory: 1G
84+
env:
85+
HOST: i686-linux-gnu
86+
ECDH: yes
87+
RECOVERY: yes
88+
EXPERIMENTAL: yes
89+
SCHNORRSIG: yes
90+
matrix:
91+
- env:
92+
CC: i686-linux-gnu-gcc
93+
- env:
94+
CC: clang --target=i686-pc-linux-gnu -isystem /usr/i686-linux-gnu/include
95+
<< : *MERGE_BASE
96+
test_script:
97+
- ./ci/cirrus.sh
98+
<< : *CAT_LOGS
99+
100+
task:
101+
name: "x86_64: macOS Catalina"
102+
macos_instance:
103+
image: catalina-base
104+
env:
105+
HOMEBREW_NO_AUTO_UPDATE: 1
106+
HOMEBREW_NO_INSTALL_CLEANUP: 1
107+
# Cirrus gives us a fixed number of 12 virtual CPUs. Not that we even have that many jobs at the moment...
108+
MAKEFLAGS: -j13
109+
matrix:
110+
<< : *ENV_MATRIX
111+
matrix:
112+
- env:
113+
CC: gcc-9
114+
- env:
115+
CC: clang
116+
# Update Command Line Tools
117+
# Uncomment this if the Command Line Tools on the CirrusCI macOS image are too old to brew valgrind.
118+
# See https://apple.stackexchange.com/a/195963 for the implementation.
119+
## update_clt_script:
120+
## - system_profiler SPSoftwareDataType
121+
## - touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
122+
## - |-
123+
## PROD=$(softwareupdate -l | grep "*.*Command Line" | tail -n 1 | awk -F"*" '{print $2}' | sed -e 's/^ *//' | sed 's/Label: //g' | tr -d '\n')
124+
## # For debugging
125+
## - softwareupdate -l && echo "PROD: $PROD"
126+
## - softwareupdate -i "$PROD" --verbose
127+
## - rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
128+
##
129+
brew_valgrind_pre_script:
130+
- brew config
131+
- brew tap --shallow LouisBrunner/valgrind
132+
# Fetch valgrind source but don't build it yet.
133+
- brew fetch --HEAD LouisBrunner/valgrind/valgrind
134+
brew_valgrind_cache:
135+
# This is $(brew --cellar valgrind) but command substition does not work here.
136+
folder: /usr/local/Cellar/valgrind
137+
# Rebuild cache if ...
138+
fingerprint_script:
139+
# ... macOS version changes:
140+
- sw_vers
141+
# ... brew changes:
142+
- brew config
143+
# ... valgrind changes:
144+
- git -C "$(brew --cache)/valgrind--git" rev-parse HEAD
145+
populate_script:
146+
# If there's no hit in the cache, build and install valgrind.
147+
- brew install --HEAD LouisBrunner/valgrind/valgrind
148+
brew_valgrind_post_script:
149+
# If we have restored valgrind from the cache, tell brew to create symlink to the PATH.
150+
# If we haven't restored from cached (and just run brew install), this is a no-op.
151+
- brew link valgrind
152+
brew_script:
153+
- brew install automake libtool gcc@9
154+
<< : *MERGE_BASE
155+
test_script:
156+
- ./ci/cirrus.sh
157+
<< : *CAT_LOGS
158+
159+
task:
160+
name: "s390x (big-endian): Linux (Debian stable, QEMU)"
161+
container:
162+
dockerfile: ci/linux-debian.Dockerfile
163+
cpu: 1
164+
memory: 1G
165+
env:
166+
WRAPPER_CMD: qemu-s390x
167+
TEST_ITERS: 16
168+
HOST: s390x-linux-gnu
169+
WITH_VALGRIND: no
170+
ECDH: yes
171+
RECOVERY: yes
172+
EXPERIMENTAL: yes
173+
SCHNORRSIG: yes
174+
CTIMETEST: no
175+
<< : *MERGE_BASE
176+
test_script:
177+
# https://sourceware.org/bugzilla/show_bug.cgi?id=27008
178+
- rm /etc/ld.so.cache
179+
- ./ci/cirrus.sh
180+
<< : *CAT_LOGS
181+
182+
task:
183+
name: "ARM32: Linux (Debian stable, QEMU)"
184+
container:
185+
dockerfile: ci/linux-debian.Dockerfile
186+
cpu: 1
187+
memory: 1G
188+
env:
189+
WRAPPER_CMD: qemu-arm
190+
TEST_ITERS: 16
191+
HOST: arm-linux-gnueabihf
192+
WITH_VALGRIND: no
193+
ECDH: yes
194+
RECOVERY: yes
195+
EXPERIMENTAL: yes
196+
SCHNORRSIG: yes
197+
CTIMETEST: no
198+
matrix:
199+
- env: {}
200+
- env: {ASM: arm}
201+
<< : *MERGE_BASE
202+
test_script:
203+
- ./ci/cirrus.sh
204+
<< : *CAT_LOGS
205+
206+
task:
207+
name: "ARM64: Linux (Debian stable, QEMU)"
208+
container:
209+
dockerfile: ci/linux-debian.Dockerfile
210+
cpu: 1
211+
memory: 1G
212+
env:
213+
WRAPPER_CMD: qemu-aarch64
214+
TEST_ITERS: 16
215+
HOST: aarch64-linux-gnu
216+
WITH_VALGRIND: no
217+
ECDH: yes
218+
RECOVERY: yes
219+
EXPERIMENTAL: yes
220+
SCHNORRSIG: yes
221+
CTIMETEST: no
222+
<< : *MERGE_BASE
223+
test_script:
224+
- ./ci/cirrus.sh
225+
<< : *CAT_LOGS
226+
227+
task:
228+
name: "ppc64le: Linux (Debian stable, QEMU)"
229+
container:
230+
dockerfile: ci/linux-debian.Dockerfile
231+
cpu: 1
232+
memory: 1G
233+
env:
234+
WRAPPER_CMD: qemu-ppc64le
235+
TEST_ITERS: 16
236+
HOST: powerpc64le-linux-gnu
237+
WITH_VALGRIND: no
238+
ECDH: yes
239+
RECOVERY: yes
240+
EXPERIMENTAL: yes
241+
SCHNORRSIG: yes
242+
CTIMETEST: no
243+
<< : *MERGE_BASE
244+
test_script:
245+
- ./ci/cirrus.sh
246+
<< : *CAT_LOGS
247+
248+
task:
249+
name: "x86_64 (mingw32-w64): Windows (Debian stable, Wine)"
250+
container:
251+
dockerfile: ci/linux-debian.Dockerfile
252+
cpu: 1
253+
memory: 1G
254+
env:
255+
WRAPPER_CMD: wine64-stable
256+
TEST_ITERS: 16
257+
HOST: x86_64-w64-mingw32
258+
WITH_VALGRIND: no
259+
ECDH: yes
260+
RECOVERY: yes
261+
EXPERIMENTAL: yes
262+
SCHNORRSIG: yes
263+
CTIMETEST: no
264+
<< : *MERGE_BASE
265+
test_script:
266+
- ./ci/cirrus.sh
267+
<< : *CAT_LOGS
268+
269+
# Sanitizers
270+
task:
271+
container:
272+
dockerfile: ci/linux-debian.Dockerfile
273+
cpu: 1
274+
memory: 1G
275+
env:
276+
ECDH: yes
277+
RECOVERY: yes
278+
EXPERIMENTAL: yes
279+
SCHNORRSIG: yes
280+
CTIMETEST: no
281+
EXTRAFLAGS: "--disable-openssl-tests"
282+
matrix:
283+
- name: "Valgrind (memcheck)"
284+
env:
285+
# 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)
286+
WRAPPER_CMD: "valgrind --error-exitcode=42"
287+
TEST_ITERS: 16
288+
- name: "UBSan, ASan, LSan"
289+
env:
290+
CFLAGS: "-fsanitize=undefined,address"
291+
CFLAGS_FOR_BUILD: "-fsanitize=undefined,address"
292+
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
293+
ASAN_OPTIONS: "strict_string_checks=1:detect_stack_use_after_return=1:detect_leaks=1"
294+
LSAN_OPTIONS: "use_unaligned=1"
295+
TEST_ITERS: 32
296+
# Try to cover many configurations with just a tiny matrix.
297+
matrix:
298+
- env:
299+
ASM: auto
300+
STATICPRECOMPUTATION: yes
301+
- env:
302+
ASM: no
303+
STATICPRECOMPUTATION: no
304+
ECMULTGENPRECISION: 2
305+
matrix:
306+
- env:
307+
CC: clang
308+
- env:
309+
HOST: i686-linux-gnu
310+
CC: i686-linux-gnu-gcc
311+
<< : *MERGE_BASE
312+
test_script:
313+
- ./ci/cirrus.sh
314+
<< : *CAT_LOGS
315+

secp256k1-sys/depend/secp256k1/.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ libtool
3333
*~
3434
*.log
3535
*.trs
36+
37+
coverage/
38+
coverage.html
39+
coverage.*.html
40+
*.gcda
41+
*.gcno
42+
*.gcov
43+
3644
src/libsecp256k1-config.h
3745
src/libsecp256k1-config.h.in
3846
src/ecmult_static_context.h

0 commit comments

Comments
 (0)