Skip to content

Commit

Permalink
Add key generation/verification to ECC sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
sipa committed Nov 23, 2014
1 parent d0c41a7 commit f321d6b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit f321d6b

Please sign in to comment.