Skip to content

Commit 95eda37

Browse files
josibakemacgyver13theStackreal-or-random
committed
tests: add BIP-352 test vectors
Add the BIP-352 test vectors. The vectors are generated with a Python script that converts the .json file from the BIP to C code: $ ./tools/tests_silentpayments_generate.py test_vectors.json > ./src/modules/silentpayments/vectors.h Co-authored-by: Ron <[email protected]> Co-authored-by: Sebastian Falbesoner <[email protected]> Co-authored-by: Tim Ruffing <[email protected]>
1 parent 6e8252b commit 95eda37

File tree

6 files changed

+5597
-0
lines changed

6 files changed

+5597
-0
lines changed

Makefile.am

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ maintainer-clean-local: clean-precomp
263263
### Pregenerated test vectors
264264
### (see the comments in the previous section for detailed rationale)
265265
TESTVECTORS = src/wycheproof/ecdsa_secp256k1_sha256_bitcoin_test.h
266+
TESTVECTORS += src/modules/silentpayments/vectors.h
266267

267268
if ENABLE_MODULE_SILENTPAYMENTS
268269
TESTVECTORS += src/modules/silentpayments/vectors.h
@@ -280,6 +281,10 @@ src/wycheproof/ecdh_secp256k1_test.h:
280281
mkdir -p $(@D)
281282
python3 $(top_srcdir)/tools/tests_wycheproof_generate_ecdh.py $(top_srcdir)/src/wycheproof/ecdh_secp256k1_test.json > $@
282283

284+
src/modules/silentpayments/vectors.h:
285+
mkdir -p $(@D)
286+
python3 $(top_srcdir)/tools/tests_silentpayments_generate.py $(top_srcdir)/src/modules/silentpayments/bip352_send_and_receive_test_vectors.json > $@
287+
283288
testvectors: $(TESTVECTORS)
284289

285290
BUILT_SOURCES += $(TESTVECTORS)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
include_HEADERS += include/secp256k1_silentpayments.h
22
noinst_HEADERS += src/modules/silentpayments/main_impl.h
33
noinst_HEADERS += src/modules/silentpayments/bench_impl.h
4+
noinst_HEADERS += src/modules/silentpayments/tests_impl.h
5+
noinst_HEADERS += src/modules/silentpayments/vectors.h

0 commit comments

Comments
 (0)