Merge 265250687b into merged_master (Bitcoin PR bitcoin/bitcoin#28455)

This commit is contained in:
Byron Hambly 2025-11-17 21:16:45 +02:00
commit e2aa52246d
No known key found for this signature in database
GPG key ID: DE8F6EA20A661697
16 changed files with 63 additions and 100 deletions

View file

@ -383,6 +383,13 @@ ECDHSecret CKey::ComputeBIP324ECDHSecret(const EllSwiftPubKey& their_ellswift, c
return output;
}
CKey GenerateRandomKey(bool compressed) noexcept
{
CKey key;
key.MakeNewKey(/*fCompressed=*/compressed);
return key;
}
bool CExtKey::Derive(CExtKey &out, unsigned int _nChild) const {
if (nDepth == std::numeric_limits<unsigned char>::max()) return false;
out.nDepth = nDepth + 1;
@ -434,8 +441,7 @@ void CExtKey::Decode(const unsigned char code[BIP32_EXTKEY_SIZE]) {
}
bool ECC_InitSanityCheck() {
CKey key;
key.MakeNewKey(true);
CKey key = GenerateRandomKey();
CPubKey pubkey = key.GetPubKey();
return key.VerifyPubKey(pubkey);
}