Skip to content

Commit 476a217

Browse files
fanquakejanus
authored andcommitted
Squashed 'src/secp256k1/' changes from 705ce7ed8c..c545fdc374
c545fdc374 Merge bitcoin-core/secp256k1#1298: Remove randomness tests b40e2d30b7 Merge bitcoin-core/secp256k1#1378: ellswift: fix probabilistic test failure when swapping sides c424e2fb43 ellswift: fix probabilistic test failure when swapping sides 907a67212e Merge bitcoin-core/secp256k1#1313: ci: Test on development snapshots of GCC and Clang 0f7657d59c Merge bitcoin-core/secp256k1#1366: field: Use `restrict` consistently in fe_sqrt cc55757552 Merge bitcoin-core/secp256k1#1340: clean up in-comment Sage code (refer to secp256k1_params.sage, update to Python3) 600c5adcd5 clean up in-comment Sage code (refer to secp256k1_params.sage, update to Python3) 981e5be38c ci: Fix typo in comment e9e9648219 ci: Reduce number of macOS tasks from 28 to 8 609093b387 ci: Add x86_64 Linux tasks for gcc and clang snapshots 1deecaaf3b ci: Install development snapshots of gcc and clang b79ba8aa4c field: Use `restrict` consistently in fe_sqrt c9ebca95f9 Merge bitcoin-core/secp256k1#1363: doc: minor ellswift.md updates afd7eb4a55 Merge bitcoin-core/secp256k1#1371: Add exhaustive tests for ellswift (with create+decode roundtrip) 2792119278 Add exhaustive test for ellswift (create+decode roundtrip) c7d900ffd1 doc: minor ellswift.md updates 332af315fc Merge bitcoin-core/secp256k1#1344: group: save normalize_weak calls in `secp256k1_ge_is_valid_var`/`secp256k1_gej_eq_x_var` 9e6d1b0e9b Merge bitcoin-core/secp256k1#1367: build: Improvements to symbol visibility logic on Windows (attempt 3) 0aacf64352 Merge bitcoin-core/secp256k1#1370: Corrected some typos b6b9834e8d small fixes 07c0e8b82e group: remove unneeded normalize_weak in `secp256k1_gej_eq_x_var` 3fc1de5c55 Merge bitcoin-core/secp256k1#1364: Avoid `-Wmaybe-uninitialized` when compiling with `gcc -O1` fb758fe8d6 Merge bitcoin-core/secp256k1#1323: tweak_add: fix API doc for tweak=0 c6cd2b15a0 ci: Add task for static library on Windows + CMake 020bf69a44 build: Add extensive docs on visibility issues 0196e8ade1 build: Introduce `SECP256k1_DLL_EXPORT` macro 9f1b1904a3 refactor: Replace `SECP256K1_API_VAR` with `SECP256K1_API` ae9db95cea build: Introduce `SECP256K1_STATIC` macro for Windows users 7966aee31d Merge bitcoin-core/secp256k1#1369: ci: Print commit in Windows container a7bec34231 ci: Print commit in Windows container 249c81eaa3 Merge bitcoin-core/secp256k1#1368: ci: Drop manual checkout of merge commit 98579e297b ci: Drop manual checkout of merge commit 5b9f37f136 ci: Add `CFLAGS: -O1` to task matrix a6ca76cdf2 Avoid `-Wmaybe-uninitialized` when compiling with `gcc -O1` 0fa84f869d Merge bitcoin-core/secp256k1#1358: tests: introduce helper for non-zero `random_fe_test()` results 5a95a268b9 tests: introduce helper for non-zero `random_fe_test` results 304421d57b tests: refactor: remove duplicate function `random_field_element_test` 3aef6ab8e1 Merge bitcoin-core/secp256k1#1345: field: Static-assert that int args affecting magnitude are constant 4494a369b6 Merge bitcoin-core/secp256k1#1357: tests: refactor: take use of `secp256k1_ge_x_on_curve_var` 799f4eec27 Merge bitcoin-core/secp256k1#1356: ci: Adjust Docker image to Debian 12 "bookworm" c862a9fb49 ci: Adjust Docker image to Debian 12 "bookworm" a1782098a9 ci: Force DWARF v4 for Clang when Valgrind tests are expected 7d8d5c86df tests: refactor: take use of `secp256k1_ge_x_on_curve_var` 8a7273465b Help the compiler prove that a loop is entered fd491ea1bb Merge bitcoin-core/secp256k1#1355: Fix a typo in the error message ac43613d25 Merge bitcoin-core/secp256k1#1354: Add ellswift to CHANGELOG 67887ae65c Fix a typo in the error message 926dd3e962 Merge bitcoin-core/secp256k1#1295: abi: Use dllexport for mingw builds 10836832e7 Merge bitcoin-core/secp256k1#1336: Use `__shiftright128` intrinsic in `secp256k1_u128_rshift` on MSVC 7c7467ab7f Refer to ellswift.md in API docs c32ffd8d8c Add ellswift to CHANGELOG 3c1a0fd37f Merge bitcoin-core/secp256k1#1347: field: Document return value of fe_sqrt() 5779137457 field: Document return value of fe_sqrt() be8ff3a02a field: Static-assert that int args affecting magnitude are constant efa76c4bf7 group: remove unneeded normalize_weak in `secp256k1_ge_is_valid_var` 5b7bf2e9d4 Use `__shiftright128` intrinsic in `secp256k1_u128_rshift` on MSVC 05873bb6b1 tweak_add: fix API doc for tweak=0 6ec3731e8c Simplify test PRNG implementation fb5bfa4eed Add static test vector for Xoshiro256++ 723e8ca8f7 Remove randomness tests bc7c8db179 abi: Use dllexport for mingw builds git-subtree-dir: src/secp256k1 git-subtree-split: c545fdc374964424683d9dac31a828adedabe860
1 parent 52edb6e commit 476a217

36 files changed

+501
-409
lines changed

.cirrus.yml

+104-68
Original file line numberDiff line numberDiff line change
@@ -52,43 +52,47 @@ cat_logs_snippet: &CAT_LOGS
5252
cat_ci_env_script:
5353
- env
5454

55-
persistent_worker_template: &PERSISTENT_WORKER_TEMPLATE
56-
persistent_worker: {} # https://cirrus-ci.org/guide/persistent-workers/
57-
58-
# https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
59-
filter_template: &FILTER_TEMPLATE
60-
skip: $CIRRUS_REPO_FULL_NAME == "BGL-core/gui" && $CIRRUS_PR == "" # No need to run on the read-only mirror, unless it is a PR. https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution
61-
stateful: false # https://cirrus-ci.org/guide/writing-tasks/#stateful-tasks
62-
63-
base_template: &BASE_TEMPLATE
64-
<< : *FILTER_TEMPLATE
65-
merge_base_script:
66-
# Unconditionally install git (used in fingerprint_script).
67-
- bash -c "$PACKAGE_MANAGER_INSTALL git"
68-
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
69-
- git fetch --depth=1 $CIRRUS_REPO_CLONE_URL "pull/${CIRRUS_PR}/merge"
70-
- git checkout FETCH_HEAD # Use merged changes to detect silent merge conflicts
71-
72-
global_task_template: &GLOBAL_TASK_TEMPLATE
73-
<< : *BASE_TEMPLATE
55+
linux_container_snippet: &LINUX_CONTAINER
7456
container:
75-
# https://cirrus-ci.org/faq/#are-there-any-limits
76-
# Each project has 16 CPU in total, assign 2 to each container, so that 8 tasks run in parallel
77-
cpu: 2
78-
memory: 8G # Set to 8GB to avoid OOM. https://cirrus-ci.org/guide/linux/#linux-containers
79-
dockerfile: ci/test_imagefile # https://cirrus-ci.org/guide/docker-builder-vm/#dockerfile-as-a-ci-environment
80-
depends_built_cache:
81-
folder: "depends/built"
82-
fingerprint_script: echo $CIRRUS_TASK_NAME $(git rev-parse HEAD:depends)
83-
84-
global_task_template: &GLOBAL_TASK_TEMPLATE
85-
<< : *CONTAINER_DEPENDS_TEMPLATE
86-
<< : *MAIN_TEMPLATE
57+
dockerfile: ci/linux-debian.Dockerfile
58+
# Reduce number of CPUs to be able to do more builds in parallel.
59+
cpu: 1
60+
# Gives us more CPUs for free if they're available.
61+
greedy: true
62+
# More than enough for our scripts.
63+
memory: 2G
8764

88-
compute_credits_template: &CREDITS_TEMPLATE
89-
# https://cirrus-ci.org/pricing/#compute-credits
90-
# Only use credits for pull requests to the main repo
91-
use_compute_credits: $CIRRUS_REPO_FULL_NAME == 'BGL/BGL' && $CIRRUS_PR != ""
65+
task:
66+
name: "x86_64: Linux (Debian stable)"
67+
<< : *LINUX_CONTAINER
68+
matrix:
69+
- env: {WIDEMUL: int64, RECOVERY: yes}
70+
- env: {WIDEMUL: int64, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
71+
- env: {WIDEMUL: int128}
72+
- env: {WIDEMUL: int128_struct, ELLSWIFT: yes}
73+
- env: {WIDEMUL: int128, RECOVERY: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
74+
- env: {WIDEMUL: int128, ECDH: yes, SCHNORRSIG: yes}
75+
- env: {WIDEMUL: int128, ASM: x86_64 , ELLSWIFT: yes}
76+
- env: { RECOVERY: yes, SCHNORRSIG: yes}
77+
- env: {CTIMETESTS: no, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, CPPFLAGS: -DVERIFY}
78+
- env: {BUILD: distcheck, WITH_VALGRIND: no, CTIMETESTS: no, BENCH: no}
79+
- env: {CPPFLAGS: -DDETERMINISTIC}
80+
- env: {CFLAGS: -O0, CTIMETESTS: no}
81+
- env: {CFLAGS: -O1, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
82+
- env: { ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
83+
- env: { ECMULTGENPRECISION: 8, ECMULTWINDOW: 4 }
84+
matrix:
85+
- env:
86+
CC: gcc
87+
- env:
88+
CC: clang
89+
- env:
90+
CC: gcc-snapshot
91+
- env:
92+
CC: clang-snapshot
93+
test_script:
94+
- ./ci/cirrus.sh
95+
<< : *CAT_LOGS
9296

9397
task:
9498
name: 'lint [bookworm]'
@@ -107,7 +111,18 @@ task:
107111
lint_script:
108112
- ./ci/lint_run_all.sh
109113
env:
110-
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
114+
HOST: i686-linux-gnu
115+
ECDH: yes
116+
RECOVERY: yes
117+
SCHNORRSIG: yes
118+
matrix:
119+
- env:
120+
CC: i686-linux-gnu-gcc
121+
- env:
122+
CC: clang --target=i686-pc-linux-gnu -isystem /usr/i686-linux-gnu/include
123+
test_script:
124+
- ./ci/cirrus.sh
125+
<< : *CAT_LOGS
111126

112127
task:
113128
name: 'tidy [lunar]'
@@ -119,28 +134,26 @@ task:
119134
CI_IMAGE_NAME_TAG: ubuntu:lunar
120135
FILE_ENV: "./ci/test/00_setup_env_native_tidy.sh"
121136
env:
122-
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
123-
124-
task:
125-
name: "Win64 native [vs2022]"
126-
<< : *FILTER_TEMPLATE
127-
windows_container:
128-
cpu: 6
129-
memory: 12G
130-
image: cirrusci/windowsservercore:visualstudio2022
131-
timeout_in: 120m
137+
HOMEBREW_NO_AUTO_UPDATE: 1
138+
HOMEBREW_NO_INSTALL_CLEANUP: 1
139+
# Cirrus gives us a fixed number of 4 virtual CPUs. Not that we even have that many jobs at the moment...
140+
MAKEFLAGS: -j5
132141
env:
133142
ASM: no
134143
WITH_VALGRIND: no
135144
CTIMETESTS: no
145+
CC: clang
136146
matrix:
137-
- env:
138-
CC: gcc
139-
- env:
140-
CC: clang
147+
- env: {WIDEMUL: int64, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
148+
- env: {WIDEMUL: int64, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes, CC: gcc}
149+
- env: {WIDEMUL: int128_struct, ECMULTGENPRECISION: 2, ECMULTWINDOW: 4}
150+
- env: {WIDEMUL: int128, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
151+
- env: {WIDEMUL: int128, RECOVERY: yes, SCHNORRSIG: yes}
152+
- env: {WIDEMUL: int128, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes, CC: gcc}
153+
- env: {WIDEMUL: int128, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes, CPPFLAGS: -DVERIFY}
154+
- env: {BUILD: distcheck}
141155
brew_script:
142156
- brew install automake libtool gcc
143-
<< : *MERGE_BASE
144157
test_script:
145158
- ./ci/cirrus.sh
146159
<< : *CAT_LOGS
@@ -164,7 +177,6 @@ task:
164177
SCHNORRSIG: yes
165178
ELLSWIFT: yes
166179
CTIMETESTS: no
167-
<< : *MERGE_BASE
168180
test_script:
169181
# https://sourceware.org/bugzilla/show_bug.cgi?id=27008
170182
- rm /etc/ld.so.cache
@@ -192,7 +204,6 @@ task:
192204
matrix:
193205
- env: {}
194206
- env: {EXPERIMENTAL: yes, ASM: arm32}
195-
<< : *MERGE_BASE
196207
test_script:
197208
- ./ci/cirrus.sh
198209
<< : *CAT_LOGS
@@ -226,7 +237,6 @@ task:
226237
SCHNORRSIG: yes
227238
ELLSWIFT: yes
228239
CTIMETESTS: no
229-
<< : *MERGE_BASE
230240
test_script:
231241
- ./ci/cirrus.sh
232242
<< : *CAT_LOGS
@@ -250,7 +260,6 @@ task:
250260
SCHNORRSIG: yes
251261
ELLSWIFT: yes
252262
CTIMETESTS: no
253-
<< : *MERGE_BASE
254263
test_script:
255264
- ./ci/cirrus.sh
256265
<< : *CAT_LOGS
@@ -263,8 +272,22 @@ task:
263272
CI_IMAGE_NAME_TAG: ubuntu:jammy
264273
FILE_ENV: "./ci/test/00_setup_env_native_msan.sh"
265274
env:
266-
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
267-
MAKEJOBS: "-j4" # Avoid excessive memory use due to MSan
275+
WRAPPER_CMD: wine
276+
WITH_VALGRIND: no
277+
ECDH: yes
278+
RECOVERY: yes
279+
SCHNORRSIG: yes
280+
CTIMETESTS: no
281+
matrix:
282+
- name: "x86_64 (mingw32-w64): Windows (Debian stable, Wine)"
283+
env:
284+
HOST: x86_64-w64-mingw32
285+
- name: "i686 (mingw32-w64): Windows (Debian stable, Wine)"
286+
env:
287+
HOST: i686-w64-mingw32
288+
test_script:
289+
- ./ci/cirrus.sh
290+
<< : *CAT_LOGS
268291

269292
task:
270293
name: '[ASan + LSan + UBSan + integer, no depends, USDT] [lunar]'
@@ -315,7 +338,6 @@ task:
315338
CC: /opt/msvc/bin/x86/cl
316339
AR: /opt/msvc/bin/x86/lib
317340
NM: /opt/msvc/bin/x86/dumpbin -symbols -headers
318-
<< : *MERGE_BASE
319341
test_script:
320342
- ./ci/cirrus.sh
321343
<< : *CAT_LOGS
@@ -366,7 +388,6 @@ task:
366388
- env:
367389
HOST: i686-linux-gnu
368390
CC: i686-linux-gnu-gcc
369-
<< : *MERGE_BASE
370391
test_script:
371392
- ./ci/cirrus.sh
372393
<< : *CAT_LOGS
@@ -375,11 +396,21 @@ task:
375396
name: '[multiprocess, i686, DEBUG] [focal]'
376397
<< : *GLOBAL_TASK_TEMPLATE
377398
container:
378-
cpu: 4
379-
memory: 16G # The default memory is too small, so double everything
380-
docker_arguments:
381-
CI_IMAGE_NAME_TAG: ubuntu:focal
382-
FILE_ENV: "./ci/test/00_setup_env_i686_multiprocess.sh"
399+
memory: 2G
400+
matrix:
401+
- env:
402+
CFLAGS: "-fsanitize=memory -g"
403+
- env:
404+
ECMULTGENPRECISION: 2
405+
ECMULTWINDOW: 2
406+
CFLAGS: "-fsanitize=memory -g -O3"
407+
test_script:
408+
- ./ci/cirrus.sh
409+
<< : *CAT_LOGS
410+
411+
task:
412+
name: "C++ -fpermissive (entire project)"
413+
<< : *LINUX_CONTAINER
383414
env:
384415
CC: g++
385416
CFLAGS: -fpermissive -g
@@ -389,7 +420,6 @@ task:
389420
RECOVERY: yes
390421
SCHNORRSIG: yes
391422
ELLSWIFT: yes
392-
<< : *MERGE_BASE
393423
test_script:
394424
- ./ci/cirrus.sh
395425
<< : *CAT_LOGS
@@ -439,11 +469,17 @@ task:
439469
# Ignore MSBuild warning MSB8029.
440470
# See: https://learn.microsoft.com/en-us/visualstudio/msbuild/errors/msb8029?view=vs-2022
441471
IgnoreWarnIntDirInTempDetected: 'true'
442-
merge_script:
443-
- PowerShell -NoLogo -Command if ($env:CIRRUS_PR -ne $null) { git fetch $env:CIRRUS_REPO_CLONE_URL pull/$env:CIRRUS_PR/merge; git reset --hard FETCH_HEAD; }
472+
matrix:
473+
- env:
474+
BUILD_SHARED_LIBS: ON
475+
- env:
476+
BUILD_SHARED_LIBS: OFF
477+
git_show_script:
478+
# Print commit to allow reproducing the job outside of CI.
479+
- git show --no-patch
444480
configure_script:
445481
- '%x64_NATIVE_TOOLS%'
446-
- cmake -E env CFLAGS="/WX" cmake -G "Visual Studio 17 2022" -A x64 -S . -B build -DSECP256K1_ENABLE_MODULE_RECOVERY=ON -DSECP256K1_BUILD_EXAMPLES=ON
482+
- cmake -E env CFLAGS="/WX" cmake -A x64 -B build -DSECP256K1_ENABLE_MODULE_RECOVERY=ON -DSECP256K1_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=%BUILD_SHARED_LIBS%
447483
build_script:
448484
- '%x64_NATIVE_TOOLS%'
449485
- cmake --build build --config RelWithDebInfo -- -property:UseMultiToolTask=true;CL_MPcount=5

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
#### Added
11+
- New module `ellswift` implements ElligatorSwift encoding for public keys and x-only Diffie-Hellman key exchange for them.
12+
ElligatorSwift permits representing secp256k1 public keys as 64-byte arrays which cannot be distinguished from uniformly random. See:
13+
- Header file `include/secp256k1_ellswift.h` which defines the new API.
14+
- Document `doc/ellswift.md` which explains the mathematical background of the scheme.
15+
- The [paper](https://eprint.iacr.org/2022/759) on which the scheme is based.
16+
17+
#### Changed
18+
- When consuming libsecp256k1 as a static library on Windows, the user must now define the `SECP256K1_STATIC` macro before including `secp256k1.h`.
19+
1020
## [0.3.2] - 2023-05-13
1121
We strongly recommend updating to 0.3.2 if you use or plan to use GCC >=13 to compile libsecp256k1. When in doubt, check the GCC version using `gcc -v`.
1222

Makefile.am

+32-35
Original file line numberDiff line numberDiff line change
@@ -149,41 +149,38 @@ exhaustive_tests_LDFLAGS = -static
149149
TESTS += exhaustive_tests
150150
endif
151151

152-
BIN_CHECKS=$(top_srcdir)/contrib/devtools/symbol-check.py \
153-
$(top_srcdir)/contrib/devtools/security-check.py \
154-
$(top_srcdir)/contrib/devtools/utils.py
155-
156-
WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/BGL.ico \
157-
$(top_srcdir)/share/pixmaps/nsis-header.bmp \
158-
$(top_srcdir)/share/pixmaps/nsis-wizard.bmp \
159-
$(top_srcdir)/doc/README_windows.txt
160-
161-
OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_INSTALLER_ICONS) \
162-
$(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
163-
164-
COVERAGE_INFO = $(COV_TOOL_WRAPPER) baseline.info \
165-
test_BGL_filtered.info total_coverage.info \
166-
baseline_filtered.info functional_test.info functional_test_filtered.info \
167-
test_BGL_coverage.info test_BGL.info fuzz.info fuzz_filtered.info fuzz_coverage.info
168-
169-
dist-hook:
170-
-$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
171-
172-
if TARGET_WINDOWS
173-
$(BGL_WIN_INSTALLER): all-recursive
174-
$(MKDIR_P) $(top_builddir)/release
175-
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BGLD_BIN) $(top_builddir)/release
176-
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BGL_QT_BIN) $(top_builddir)/release
177-
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BGL_TEST_BIN) $(top_builddir)/release
178-
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BGL_CLI_BIN) $(top_builddir)/release
179-
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BGL_TX_BIN) $(top_builddir)/release
180-
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BGL_WALLET_BIN) $(top_builddir)/release
181-
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BGL_UTIL_BIN) $(top_builddir)/release
182-
@test -f $(MAKENSIS) && echo 'OutFile "$@"' | cat $(top_builddir)/share/setup.nsi - | $(MAKENSIS) -V2 - || \
183-
echo error: could not build $@
184-
@echo built $@
185-
186-
deploy: $(BGL_WIN_INSTALLER)
152+
if USE_EXAMPLES
153+
noinst_PROGRAMS += ecdsa_example
154+
ecdsa_example_SOURCES = examples/ecdsa.c
155+
ecdsa_example_CPPFLAGS = -I$(top_srcdir)/include -DSECP256K1_STATIC
156+
ecdsa_example_LDADD = libsecp256k1.la
157+
ecdsa_example_LDFLAGS = -static
158+
if BUILD_WINDOWS
159+
ecdsa_example_LDFLAGS += -lbcrypt
160+
endif
161+
TESTS += ecdsa_example
162+
if ENABLE_MODULE_ECDH
163+
noinst_PROGRAMS += ecdh_example
164+
ecdh_example_SOURCES = examples/ecdh.c
165+
ecdh_example_CPPFLAGS = -I$(top_srcdir)/include -DSECP256K1_STATIC
166+
ecdh_example_LDADD = libsecp256k1.la
167+
ecdh_example_LDFLAGS = -static
168+
if BUILD_WINDOWS
169+
ecdh_example_LDFLAGS += -lbcrypt
170+
endif
171+
TESTS += ecdh_example
172+
endif
173+
if ENABLE_MODULE_SCHNORRSIG
174+
noinst_PROGRAMS += schnorr_example
175+
schnorr_example_SOURCES = examples/schnorr.c
176+
schnorr_example_CPPFLAGS = -I$(top_srcdir)/include -DSECP256K1_STATIC
177+
schnorr_example_LDADD = libsecp256k1.la
178+
schnorr_example_LDFLAGS = -static
179+
if BUILD_WINDOWS
180+
schnorr_example_LDFLAGS += -lbcrypt
181+
endif
182+
TESTS += schnorr_example
183+
endif
187184
endif
188185

189186
### Precomputed tables

0 commit comments

Comments
 (0)