diff options
| author | Pieter Wuille <[email protected]> | 2014-11-06 01:17:48 -0800 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2014-11-23 10:47:39 +0100 |
| commit | d0c41a73501a0bf94fca91be5fb38ab039490843 (patch) | |
| tree | 46da9cfe49a652b7853fcb3d1fb4ba0e6c52a9d7 /src/key.h | |
| parent | Merge pull request #5350 (diff) | |
| download | discoin-d0c41a73501a0bf94fca91be5fb38ab039490843.tar.xz discoin-d0c41a73501a0bf94fca91be5fb38ab039490843.zip | |
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.
Diffstat (limited to 'src/key.h')
| -rw-r--r-- | src/key.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); |