diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2014-11-08 14:29:45 -0800 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2014-11-23 10:47:39 +0100 |
commit | f321d6bfff4dbbb4c52d0f175a27d54b287e81ff (patch) | |
tree | 90ee9fe6b31313c4fed27ec6e8adea89daa10178 /src | |
parent | d0c41a73501a0bf94fca91be5fb38ab039490843 (diff) |
Add key generation/verification to ECC sanity check
Diffstat (limited to 'src')
-rw-r--r-- | src/key.cpp | 10 |
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); } |