aboutsummaryrefslogtreecommitdiff
path: root/src/test/key_tests.cpp
diff options
context:
space:
mode:
authorjosibake <josibake@protonmail.com>2024-05-07 11:16:45 +0200
committerjosibake <josibake@protonmail.com>2024-05-14 11:44:33 +0200
commit9408a04e424cee0d226bde79171bd4954f9caeb0 (patch)
tree1e8ddf3ae845d3190fa117947e0df8557edcc17b /src/test/key_tests.cpp
parentb946f8a4c51be42e52d63a6d578158c0b2a6b7ed (diff)
downloadbitcoin-9408a04e424cee0d226bde79171bd4954f9caeb0.tar.xz
tests, fuzz: use new NUMS_H const
Diffstat (limited to 'src/test/key_tests.cpp')
-rw-r--r--src/test/key_tests.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/key_tests.cpp b/src/test/key_tests.cpp
index 86a8d17a76..aaf4ca4977 100644
--- a/src/test/key_tests.cpp
+++ b/src/test/key_tests.cpp
@@ -6,6 +6,7 @@
#include <common/system.h>
#include <key_io.h>
+#include <span.h>
#include <streams.h>
#include <test/util/random.h>
#include <test/util/setup_common.h>
@@ -364,4 +365,13 @@ BOOST_AUTO_TEST_CASE(key_ellswift)
}
}
+BOOST_AUTO_TEST_CASE(bip341_test_h)
+{
+ std::vector<unsigned char> G_uncompressed = ParseHex("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8");
+ HashWriter hw;
+ hw.write(MakeByteSpan(G_uncompressed));
+ XOnlyPubKey H{hw.GetSHA256()};
+ BOOST_CHECK(XOnlyPubKey::NUMS_H == H);
+}
+
BOOST_AUTO_TEST_SUITE_END()