Skip to content

Commit 717db87

Browse files
committed
Squashed 'src/secp256k1/' changes from b9313c6e1a..9e85256bbe
9e85256bbe docs: update README 4b1fb2c186 ci: enable silentpayments module de508a78ac tests: add constant time tests 45427dd4d7 tests: add BIP-352 test vectors 6975614517 silentpayments: add benchmarks for scanning a9af9ebf35 silentpayments: add examples/silentpayments.c b06254b6c7 silentpayments: receiving 3c9362dd6a silentpayments: recipient label support 70e20b7145 silentpayments: sending cf44324b5e build: add skeleton for new silentpayments (BIP352) module REVERT: b9313c6e1a Merge bitcoin-core/secp256k1#1708: release cleanup: bump version after 0.7.0 REVERT: a660a4976e Merge bitcoin-core/secp256k1#1707: release: Prepare for 0.7.0 REVERT: 7ab8b0cc01 release cleanup: bump version after 0.7.0 REVERT: a3e742d947 release: Prepare for 0.7.0 REVERT: f67b0ac1a0 ci: Don't hardcode ABI version REVERT: 020ee60495 Merge bitcoin-core/secp256k1#1706: musig/tests: initialize keypair REVERT: cde4130898 musig/tests: initialize keypair REVERT: 6037833c9e Merge bitcoin-core/secp256k1#1702: changelog: update REVERT: 40b4a06520 changelog: update REVERT: 5e74086dc8 Merge bitcoin-core/secp256k1#1705: musig/test: Remove dead code REVERT: 7c3380423c Merge bitcoin-core/secp256k1#1696: build: Refactor visibility logic and add override REVERT: 8d967a602b musig/test: Remove dead code REVERT: 983711cd6d musig/tests: Refactor vectors_signverify REVERT: 73a695958a Merge bitcoin-core/secp256k1#1704: cmake: Make `secp256k1_objs` inherit interface defines from `secp256k1` REVERT: bf082221ff cmake: Make `secp256k1_objs` inherit interface defines from `secp256k1` REVERT: c82d84bb86 build: add CMake option for disabling symbol visibility attributes REVERT: ce7923874f build: Add SECP256K1_NO_API_VISIBILITY_ATTRIBUTES REVERT: e5297f6d79 build: Refactor visibility logic REVERT: cbbbf3bd6e Merge bitcoin-core/secp256k1#1699: ci: enable musig module for native macOS arm64 job REVERT: 943479a7a3 Merge bitcoin-core/secp256k1#1694: Revert "cmake: configure libsecp256k1.pc during install" REVERT: 3352f9d667 ci: enable musig module for native macOS arm64 job REVERT: 44b205e9ee Revert "cmake: configure libsecp256k1.pc during install" git-subtree-dir: src/secp256k1 git-subtree-split: 9e85256bbe527bf084222ee08dade9ea497d5c99
1 parent 5600e6f commit 717db87

28 files changed

+10059
-111
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ env:
3535
SCHNORRSIG: 'no'
3636
MUSIG: 'no'
3737
ELLSWIFT: 'no'
38+
SILENTPAYMENTS: 'no'
3839
### test options
3940
SECP256K1_TEST_ITERS: 64
4041
BENCH: 'yes'
@@ -84,18 +85,18 @@ jobs:
8485
matrix:
8586
configuration:
8687
- env_vars: { WIDEMUL: 'int64', RECOVERY: 'yes' }
87-
- env_vars: { WIDEMUL: 'int64', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes' }
88+
- env_vars: { WIDEMUL: 'int64', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', SILENTPAYMENTS: 'yes' }
8889
- env_vars: { WIDEMUL: 'int128' }
8990
- env_vars: { WIDEMUL: 'int128_struct', ELLSWIFT: 'yes' }
9091
- env_vars: { WIDEMUL: 'int128', RECOVERY: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes' }
91-
- env_vars: { WIDEMUL: 'int128', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes' }
92+
- env_vars: { WIDEMUL: 'int128', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', SILENTPAYMENTS: 'yes' }
9293
- env_vars: { WIDEMUL: 'int128', ASM: 'x86_64', ELLSWIFT: 'yes' }
9394
- env_vars: { RECOVERY: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes' }
94-
- env_vars: { CTIMETESTS: 'no', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', CPPFLAGS: '-DVERIFY' }
95+
- env_vars: { CTIMETESTS: 'no', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', SILENTPAYMENTS: 'yes', CPPFLAGS: '-DVERIFY' }
9596
- env_vars: { BUILD: 'distcheck', WITH_VALGRIND: 'no', CTIMETESTS: 'no', BENCH: 'no' }
9697
- env_vars: { CPPFLAGS: '-DDETERMINISTIC' }
9798
- env_vars: { CFLAGS: '-O0', CTIMETESTS: 'no' }
98-
- env_vars: { CFLAGS: '-O1', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes' }
99+
- env_vars: { CFLAGS: '-O1', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', SILENTPAYMENTS: 'yes' }
99100
- env_vars: { ECMULTGENKB: 2, ECMULTWINDOW: 2 }
100101
- env_vars: { ECMULTGENKB: 86, ECMULTWINDOW: 4 }
101102
cc:
@@ -142,6 +143,7 @@ jobs:
142143
SCHNORRSIG: 'yes'
143144
MUSIG: 'yes'
144145
ELLSWIFT: 'yes'
146+
SILENTPAYMENTS: 'yes'
145147
CC: ${{ matrix.cc }}
146148

147149
steps:
@@ -174,6 +176,7 @@ jobs:
174176
SCHNORRSIG: 'yes'
175177
MUSIG: 'yes'
176178
ELLSWIFT: 'yes'
179+
SILENTPAYMENTS: 'yes'
177180
CTIMETESTS: 'no'
178181

179182
steps:
@@ -214,6 +217,7 @@ jobs:
214217
SCHNORRSIG: 'yes'
215218
MUSIG: 'yes'
216219
ELLSWIFT: 'yes'
220+
SILENTPAYMENTS: 'yes'
217221
CTIMETESTS: 'no'
218222

219223
steps:
@@ -245,6 +249,7 @@ jobs:
245249
SCHNORRSIG: 'yes'
246250
MUSIG: 'yes'
247251
ELLSWIFT: 'yes'
252+
SILENTPAYMENTS: 'yes'
248253
CTIMETESTS: 'no'
249254
CC: ${{ matrix.cc }}
250255

@@ -287,6 +292,7 @@ jobs:
287292
SCHNORRSIG: 'yes'
288293
MUSIG: 'yes'
289294
ELLSWIFT: 'yes'
295+
SILENTPAYMENTS: 'yes'
290296
CTIMETESTS: 'no'
291297

292298
steps:
@@ -348,6 +354,7 @@ jobs:
348354
SCHNORRSIG: 'yes'
349355
MUSIG: 'yes'
350356
ELLSWIFT: 'yes'
357+
SILENTPAYMENTS: 'yes'
351358
CTIMETESTS: 'no'
352359
SECP256K1_TEST_ITERS: 2
353360

@@ -387,6 +394,7 @@ jobs:
387394
SCHNORRSIG: 'yes'
388395
MUSIG: 'yes'
389396
ELLSWIFT: 'yes'
397+
SILENTPAYMENTS: 'yes'
390398
CTIMETESTS: 'no'
391399
CFLAGS: '-fsanitize=undefined,address -g'
392400
UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1'
@@ -440,6 +448,7 @@ jobs:
440448
SCHNORRSIG: 'yes'
441449
MUSIG: 'yes'
442450
ELLSWIFT: 'yes'
451+
SILENTPAYMENTS: 'yes'
443452
CC: 'clang'
444453
SECP256K1_TEST_ITERS: 32
445454
ASM: 'no'
@@ -476,6 +485,7 @@ jobs:
476485
SCHNORRSIG: 'yes'
477486
MUSIG: 'yes'
478487
ELLSWIFT: 'yes'
488+
SILENTPAYMENTS: 'yes'
479489
CTIMETESTS: 'no'
480490

481491
strategy:
@@ -519,14 +529,14 @@ jobs:
519529
fail-fast: false
520530
matrix:
521531
env_vars:
522-
- { WIDEMUL: 'int64', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes' }
532+
- { WIDEMUL: 'int64', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', SILENTPAYMENTS: 'yes' }
523533
- { WIDEMUL: 'int128_struct', ECMULTGENKB: 2, ECMULTWINDOW: 4 }
524-
- { WIDEMUL: 'int128', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes' }
534+
- { WIDEMUL: 'int128', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', SILENTPAYMENTS: 'yes' }
525535
- { WIDEMUL: 'int128', RECOVERY: 'yes' }
526-
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes' }
527-
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', CC: 'gcc' }
528-
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', WRAPPER_CMD: 'valgrind --error-exitcode=42', SECP256K1_TEST_ITERS: 2 }
529-
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', CC: 'gcc', WRAPPER_CMD: 'valgrind --error-exitcode=42', SECP256K1_TEST_ITERS: 2 }
536+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', SILENTPAYMENTS: 'yes' }
537+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', SILENTPAYMENTS: 'yes', CC: 'gcc' }
538+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', SILENTPAYMENTS: 'yes', WRAPPER_CMD: 'valgrind --error-exitcode=42', SECP256K1_TEST_ITERS: 2 }
539+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', SILENTPAYMENTS: 'yes', CC: 'gcc', WRAPPER_CMD: 'valgrind --error-exitcode=42', SECP256K1_TEST_ITERS: 2 }
530540
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', CPPFLAGS: '-DVERIFY', CTIMETESTS: 'no' }
531541
- BUILD: 'distcheck'
532542

@@ -573,13 +583,13 @@ jobs:
573583
fail-fast: false
574584
matrix:
575585
env_vars:
576-
- { WIDEMUL: 'int64', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes' }
586+
- { WIDEMUL: 'int64', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes' }
577587
- { WIDEMUL: 'int128_struct', ECMULTGENPRECISION: 2, ECMULTWINDOW: 4 }
578-
- { WIDEMUL: 'int128', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes' }
588+
- { WIDEMUL: 'int128', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes' }
579589
- { WIDEMUL: 'int128', RECOVERY: 'yes' }
580-
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes' }
581-
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', CC: 'gcc' }
582-
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', CPPFLAGS: '-DVERIFY' }
590+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes' }
591+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', CC: 'gcc' }
592+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', CPPFLAGS: '-DVERIFY' }
583593
- BUILD: 'distcheck'
584594

585595
steps:
@@ -652,11 +662,10 @@ jobs:
652662
653663
- name: Symbol check
654664
if: ${{ matrix.configuration.symbol_check }}
655-
shell: bash
656665
run: |
657666
py -3 --version
658667
py -3 -m pip install lief
659-
py -3 ./tools/symbol-check.py build/bin/RelWithDebInfo/libsecp256k1-*.dll
668+
py -3 .\tools\symbol-check.py build\bin\RelWithDebInfo\libsecp256k1-5.dll
660669
661670
- name: Check
662671
run: |
@@ -697,6 +706,7 @@ jobs:
697706
SCHNORRSIG: 'yes'
698707
MUSIG: 'yes'
699708
ELLSWIFT: 'yes'
709+
SILENTPAYMENTS: 'yes'
700710

701711
steps:
702712
- name: Checkout

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ecdsa_example
1212
schnorr_example
1313
ellswift_example
1414
musig_example
15+
silentpayments_example
1516
*.exe
1617
*.so
1718
*.a

CHANGELOG.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
## [0.7.0] - 2025-07-21
11-
12-
#### Added
13-
- CMake: Added `secp256k1_objs` interface library to allow parent projects to embed libsecp256k1 object files into their own static libraries.
14-
- build: Added `SECP256K1_NO_API_VISIBILITY_ATTRIBUTES` preprocessor flag (CMake option: `SECP256K1_ENABLE_API_VISIBILITY_ATTRIBUTES`) that disables explicit "visibility" attributes for API symbols. Defining this macro enables the user to control the visibility of the API symbols via `-fvisibility=<value>` when building libsecp256k1. (All non-API declarations will always have hidden visibility, even with `SECP256K1_ENABLE_API_VISIBILITY_ATTRIBUTES` defined.) For instance, `-fvisibility=hidden` can be useful even for the API symbols, e.g., when building a static libsecp256k1 which is linked into a shared library, and the latter should not re-export the libsecp256k1 API.
15-
16-
#### Changed
17-
- The pointers `secp256k1_context_static` and `secp256k1_context_no_precomp` to the constant context objects are now `const`.
18-
- Removed `SECP256K1_WARN_UNUSED_RESULT` attribute (defined as `__attribute__ ((__warn_unused_result__))`) from several API functions that always return 1. Compilers will no longer warn if the return value is unused.
19-
- CMake: Building with CMake is no longer considered experimental.
20-
- CMake: The minimum required CMake version was increased to 3.22.
21-
- CMake: Shared libraries built with CMake on FreeBSD now create the full versioned filename and symlink chain, matching the behavior of autotools builds.
22-
2310
#### Removed
2411
- Removed previously deprecated function aliases `secp256k1_ec_privkey_negate`, `secp256k1_ec_privkey_tweak_add` and
2512
`secp256k1_ec_privkey_tweak_mul`. Use `secp256k1_ec_seckey_negate`, `secp256k1_ec_seckey_tweak_add` and
2613
`secp256k1_ec_seckey_tweak_mul` instead.
2714

28-
#### ABI Compatibility
29-
The symbols `secp256k1_ec_privkey_negate`, `secp256k1_ec_privkey_tweak_add`, and `secp256k1_ec_privkey_tweak_mul` were removed.
30-
The pointers `secp256k1_context_static` and `secp256k1_context_no_precomp` have been made `const`.
31-
Otherwise, the library maintains backward compatibility with version 0.6.0.
32-
3315
## [0.6.0] - 2024-11-04
3416

3517
#### Added
@@ -187,8 +169,7 @@ This version was in fact never released.
187169
The number was given by the build system since the introduction of autotools in Jan 2014 (ea0fe5a5bf0c04f9cc955b2966b614f5f378c6f6).
188170
Therefore, this version number does not uniquely identify a set of source files.
189171

190-
[unreleased]: https://github.com/bitcoin-core/secp256k1/compare/v0.7.0...HEAD
191-
[0.7.0]: https://github.com/bitcoin-core/secp256k1/compare/v0.6.0...v0.7.0
172+
[unreleased]: https://github.com/bitcoin-core/secp256k1/compare/v0.6.0...HEAD
192173
[0.6.0]: https://github.com/bitcoin-core/secp256k1/compare/v0.5.1...v0.6.0
193174
[0.5.1]: https://github.com/bitcoin-core/secp256k1/compare/v0.5.0...v0.5.1
194175
[0.5.0]: https://github.com/bitcoin-core/secp256k1/compare/v0.4.1...v0.5.0

CMakeLists.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ project(libsecp256k1
77
# The package (a.k.a. release) version is based on semantic versioning 2.0.0 of
88
# the API. All changes in experimental modules are treated as
99
# backwards-compatible and therefore at most increase the minor version.
10-
VERSION 0.7.1
10+
VERSION 0.6.1
1111
DESCRIPTION "Optimized C library for ECDSA signatures and secret/public key operations on curve secp256k1."
1212
HOMEPAGE_URL "https://github.com/bitcoin-core/secp256k1"
1313
LANGUAGES C
@@ -21,7 +21,7 @@ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
2121
# https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
2222
# All changes in experimental modules are treated as if they don't affect the
2323
# interface and therefore only increase the revision.
24-
set(${PROJECT_NAME}_LIB_VERSION_CURRENT 6)
24+
set(${PROJECT_NAME}_LIB_VERSION_CURRENT 5)
2525
set(${PROJECT_NAME}_LIB_VERSION_REVISION 1)
2626
set(${PROJECT_NAME}_LIB_VERSION_AGE 0)
2727

@@ -42,8 +42,6 @@ endif()
4242

4343
option(SECP256K1_INSTALL "Enable installation." ${PROJECT_IS_TOP_LEVEL})
4444

45-
option(SECP256K1_ENABLE_API_VISIBILITY_ATTRIBUTES "Enable visibility attributes in the API." ON)
46-
4745
## Modules
4846

4947
# We declare all options before processing them, to make sure we can express
@@ -54,6 +52,7 @@ option(SECP256K1_ENABLE_MODULE_EXTRAKEYS "Enable extrakeys module." ON)
5452
option(SECP256K1_ENABLE_MODULE_SCHNORRSIG "Enable schnorrsig module." ON)
5553
option(SECP256K1_ENABLE_MODULE_MUSIG "Enable musig module." ON)
5654
option(SECP256K1_ENABLE_MODULE_ELLSWIFT "Enable ElligatorSwift module." ON)
55+
option(SECP256K1_ENABLE_MODULE_SILENTPAYMENTS "Enable Silent Payments module." ON)
5756

5857
option(SECP256K1_USE_EXTERNAL_DEFAULT_CALLBACKS "Enable external default callback functions." OFF)
5958
if(SECP256K1_USE_EXTERNAL_DEFAULT_CALLBACKS)
@@ -287,6 +286,7 @@ message(" extrakeys ........................... ${SECP256K1_ENABLE_MODULE_EXTRA
287286
message(" schnorrsig .......................... ${SECP256K1_ENABLE_MODULE_SCHNORRSIG}")
288287
message(" musig ............................... ${SECP256K1_ENABLE_MODULE_MUSIG}")
289288
message(" ElligatorSwift ...................... ${SECP256K1_ENABLE_MODULE_ELLSWIFT}")
289+
message(" Silent Payments ..................... ${SECP256K1_ENABLE_MODULE_SILENTPAYMENTS}")
290290
message("Parameters:")
291291
message(" ecmult window size .................. ${SECP256K1_ECMULT_WINDOW_SIZE}")
292292
message(" ecmult gen table size ............... ${SECP256K1_ECMULT_GEN_KB} KiB")
@@ -314,7 +314,6 @@ else()
314314
set(cross_status "FALSE")
315315
endif()
316316
message("Cross compiling ....................... ${cross_status}")
317-
message("API visibility attributes ............. ${SECP256K1_ENABLE_API_VISIBILITY_ATTRIBUTES}")
318317
message("Valgrind .............................. ${SECP256K1_VALGRIND}")
319318
get_directory_property(definitions COMPILE_DEFINITIONS)
320319
string(REPLACE ";" " " definitions "${definitions}")

Makefile.am

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,17 @@ musig_example_LDFLAGS += -lbcrypt
207207
endif
208208
TESTS += musig_example
209209
endif
210+
if ENABLE_MODULE_SILENTPAYMENTS
211+
noinst_PROGRAMS += silentpayments_example
212+
silentpayments_example_SOURCES = examples/silentpayments.c
213+
silentpayments_example_CPPFLAGS = -I$(top_srcdir)/include -DSECP256K1_STATIC
214+
silentpayments_example_LDADD = libsecp256k1.la
215+
silentpayments_example_LDFLAGS = -static
216+
if BUILD_WINDOWS
217+
silentpayments_example_LDFLAGS += -lbcrypt
218+
endif
219+
TESTS += silentpayments_example
220+
endif
210221
endif
211222

212223
### Precomputed tables
@@ -249,6 +260,7 @@ maintainer-clean-local: clean-precomp
249260
### Pregenerated test vectors
250261
### (see the comments in the previous section for detailed rationale)
251262
TESTVECTORS = src/wycheproof/ecdsa_secp256k1_sha256_bitcoin_test.h
263+
TESTVECTORS += src/modules/silentpayments/vectors.h
252264

253265
if ENABLE_MODULE_ECDH
254266
TESTVECTORS += src/wycheproof/ecdh_secp256k1_test.h
@@ -262,6 +274,10 @@ src/wycheproof/ecdh_secp256k1_test.h:
262274
mkdir -p $(@D)
263275
python3 $(top_srcdir)/tools/tests_wycheproof_generate_ecdh.py $(top_srcdir)/src/wycheproof/ecdh_secp256k1_test.json > $@
264276

277+
src/modules/silentpayments/vectors.h:
278+
mkdir -p $(@D)
279+
python3 $(top_srcdir)/tools/tests_silentpayments_generate.py $(top_srcdir)/src/modules/silentpayments/bip352_send_and_receive_test_vectors.json > $@
280+
265281
testvectors: $(TESTVECTORS)
266282

267283
BUILT_SOURCES += $(TESTVECTORS)
@@ -311,3 +327,7 @@ endif
311327
if ENABLE_MODULE_ELLSWIFT
312328
include src/modules/ellswift/Makefile.am.include
313329
endif
330+
331+
if ENABLE_MODULE_SILENTPAYMENTS
332+
include src/modules/silentpayments/Makefile.am.include
333+
endif

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Features:
2222
* Optional module for Schnorr signatures according to [BIP-340](https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki).
2323
* Optional module for ElligatorSwift key exchange according to [BIP-324](https://github.com/bitcoin/bips/blob/master/bip-0324.mediawiki).
2424
* Optional module for MuSig2 Schnorr multi-signatures according to [BIP-327](https://github.com/bitcoin/bips/blob/master/bip-0327.mediawiki).
25+
* Optional module for Silent Payments send and receive according to [BIP-352](https://github.com/bitcoin/bips/blob/master/bip-0352.mediawiki).
2526

2627
Implementation details
2728
----------------------
@@ -152,6 +153,7 @@ Usage examples can be found in the [examples](examples) directory. To compile th
152153
* [Deriving a shared secret (ECDH) example](examples/ecdh.c)
153154
* [ElligatorSwift key exchange example](examples/ellswift.c)
154155
* [MuSig2 Schnorr multi-signatures example](examples/musig.c)
156+
* [Silent Payments send and receive example](examples/silentpayments.c)
155157
156158
To compile the examples, make sure the corresponding modules are enabled.
157159

ci/ci.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ print_environment() {
1313
# does not rely on bash.
1414
for var in WERROR_CFLAGS MAKEFLAGS BUILD \
1515
ECMULTWINDOW ECMULTGENKB ASM WIDEMUL WITH_VALGRIND EXTRAFLAGS \
16-
EXPERIMENTAL ECDH RECOVERY EXTRAKEYS MUSIG SCHNORRSIG ELLSWIFT \
16+
EXPERIMENTAL ECDH RECOVERY EXTRAKEYS MUSIG SCHNORRSIG ELLSWIFT SILENTPAYMENTS \
1717
SECP256K1_TEST_ITERS BENCH SECP256K1_BENCH_ITERS CTIMETESTS SYMBOL_CHECK \
1818
EXAMPLES \
1919
HOST WRAPPER_CMD \
@@ -80,6 +80,7 @@ esac
8080
--enable-module-extrakeys="$EXTRAKEYS" \
8181
--enable-module-schnorrsig="$SCHNORRSIG" \
8282
--enable-module-musig="$MUSIG" \
83+
--enable-module-silentpayments="$SILENTPAYMENTS" \
8384
--enable-examples="$EXAMPLES" \
8485
--enable-ctime-tests="$CTIMETESTS" \
8586
--with-valgrind="$WITH_VALGRIND" \
@@ -113,7 +114,7 @@ then
113114
case "$HOST" in
114115
*mingw*)
115116
ls -l .libs
116-
python3 ./tools/symbol-check.py .libs/libsecp256k1-*.dll
117+
python3 ./tools/symbol-check.py .libs/libsecp256k1-5.dll
117118
;;
118119
*)
119120
python3 ./tools/symbol-check.py .libs/libsecp256k1.so

cmake/GeneratePkgConfigFile.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
function(generate_pkg_config_file in_file)
2-
set(prefix ${CMAKE_INSTALL_PREFIX})
2+
set(prefix "@CMAKE_INSTALL_PREFIX@")
33
set(exec_prefix \${prefix})
44
set(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR})
55
set(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR})
66
set(PACKAGE_VERSION ${PROJECT_VERSION})
7-
configure_file(${in_file} ${PROJECT_NAME}.pc @ONLY)
7+
configure_file(${in_file} ${PROJECT_NAME}.pc.in @ONLY)
8+
install(CODE "configure_file(
9+
\"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc.in\"
10+
\"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc\"
11+
@ONLY)" ALL_COMPONENTS)
812
endfunction()

0 commit comments

Comments
 (0)