Skip to content

Commit f321d6b

Browse files
committed
Add key generation/verification to ECC sanity check
1 parent d0c41a7 commit f321d6b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/key.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,5 +201,13 @@ void CExtKey::Decode(const unsigned char code[74]) {
201201
}
202202

203203
bool ECC_InitSanityCheck() {
204-
return CECKey::SanityCheck();
204+
#if !defined(USE_SECP256K1)
205+
if (!CECKey::SanityCheck()) {
206+
return false;
207+
}
208+
#endif
209+
CKey key;
210+
key.MakeNewKey(true);
211+
CPubKey pubkey = key.GetPubKey();
212+
return key.VerifyPubKey(pubkey);
205213
}

0 commit comments

Comments
 (0)