mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Add sanity check after key generation
Add a sanity check to prevent cosmic rays from flipping a bit in the generated public key, or bugs in the elliptic curve code. This is simply done by signing a (randomized) message, and verifying the result.
This commit is contained in:
@@ -136,6 +136,12 @@ public:
|
||||
//! Derive BIP32 child key.
|
||||
bool Derive(CKey& keyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const;
|
||||
|
||||
/**
|
||||
* Verify thoroughly whether a private key and a public key match.
|
||||
* This is done using a different mechanism than just regenerating it.
|
||||
*/
|
||||
bool VerifyPubKey(const CPubKey& vchPubKey) const;
|
||||
|
||||
//! Load private key and check that public key matches.
|
||||
bool Load(CPrivKey& privkey, CPubKey& vchPubKey, bool fSkipCheck);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user