aboutsummaryrefslogtreecommitdiff
path: root/src/key.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2014-11-08 14:29:45 -0800
committerPieter Wuille <pieter.wuille@gmail.com>2014-11-23 10:47:39 +0100
commitf321d6bfff4dbbb4c52d0f175a27d54b287e81ff (patch)
tree90ee9fe6b31313c4fed27ec6e8adea89daa10178 /src/key.cpp
parentd0c41a73501a0bf94fca91be5fb38ab039490843 (diff)
Add key generation/verification to ECC sanity check
Diffstat (limited to 'src/key.cpp')
-rw-r--r--src/key.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/key.cpp b/src/key.cpp
index 826af7f44a..a91ed1cc1d 100644
--- a/src/key.cpp
+++ b/src/key.cpp
@@ -201,5 +201,13 @@ void CExtKey::Decode(const unsigned char code[74]) {
}
bool ECC_InitSanityCheck() {
- return CECKey::SanityCheck();
+#if !defined(USE_SECP256K1)
+ if (!CECKey::SanityCheck()) {
+ return false;
+ }
+#endif
+ CKey key;
+ key.MakeNewKey(true);
+ CPubKey pubkey = key.GetPubKey();
+ return key.VerifyPubKey(pubkey);
}