Add key generation/verification to ECC sanity check

This commit is contained in:
Pieter Wuille 2014-11-08 14:29:45 -08:00
parent d0c41a7350
commit f321d6bfff

View file

@ -201,5 +201,13 @@ void CExtKey::Decode(const unsigned char code[74]) {
} }
bool ECC_InitSanityCheck() { 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);
} }