Skip to content

Commit ba85ac5

Browse files
josibakemacgyver13theStack
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]>
1 parent 1d70f00 commit ba85ac5

File tree

6 files changed

+7641
-0
lines changed

6 files changed

+7641
-0
lines changed

Makefile.am

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

264265
if ENABLE_MODULE_ECDH
265266
TESTVECTORS += src/wycheproof/ecdh_secp256k1_test.h
@@ -273,6 +274,10 @@ src/wycheproof/ecdh_secp256k1_test.h:
273274
mkdir -p $(@D)
274275
python3 $(top_srcdir)/tools/tests_wycheproof_generate_ecdh.py $(top_srcdir)/src/wycheproof/ecdh_secp256k1_test.json > $@
275276

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+
276281
testvectors: $(TESTVECTORS)
277282

278283
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)