From 202291722300b86f36e97de7960d40a32544c2d1 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 13 Dec 2022 14:47:54 -0500 Subject: [PATCH] Add secp256k1_selftest call --- src/pubkey.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/pubkey.cpp b/src/pubkey.cpp index 6c068fcc06e..fe684b264b1 100644 --- a/src/pubkey.cpp +++ b/src/pubkey.cpp @@ -16,6 +16,18 @@ #include #include +namespace { + +struct Secp256k1SelfTester +{ + Secp256k1SelfTester() { + /* Run libsecp256k1 self-test before using the secp256k1_context_static. */ + secp256k1_selftest(); + } +} SECP256K1_SELFTESTER; + +} // namespace + /** This function is taken from the libsecp256k1 distribution and implements * DER parsing for ECDSA signatures, while supporting an arbitrary subset of * format violations.