Skip to content

Commit 2022917

Browse files
committed
Add secp256k1_selftest call
1 parent 3bfca78 commit 2022917

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/pubkey.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@
1616
#include <algorithm>
1717
#include <cassert>
1818

19+
namespace {
20+
21+
struct Secp256k1SelfTester
22+
{
23+
Secp256k1SelfTester() {
24+
/* Run libsecp256k1 self-test before using the secp256k1_context_static. */
25+
secp256k1_selftest();
26+
}
27+
} SECP256K1_SELFTESTER;
28+
29+
} // namespace
30+
1931
/** This function is taken from the libsecp256k1 distribution and implements
2032
* DER parsing for ECDSA signatures, while supporting an arbitrary subset of
2133
* format violations.

0 commit comments

Comments
 (0)