aboutsummaryrefslogtreecommitdiff
path: root/src/key.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/key.h')
-rw-r--r--src/key.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/key.h b/src/key.h
index 104a8f5c72..021eac2a8d 100644
--- a/src/key.h
+++ b/src/key.h
@@ -6,6 +6,7 @@
#ifndef BITCOIN_KEY_H
#define BITCOIN_KEY_H
+#include "pubkey.h"
#include "serialize.h"
#include "support/allocators/secure.h"
#include "uint256.h"
@@ -13,9 +14,6 @@
#include <stdexcept>
#include <vector>
-class CPubKey;
-
-struct CExtPubKey;
/**
* secp256k1:
@@ -138,7 +136,7 @@ public:
bool SignCompact(const uint256& hash, std::vector<unsigned char>& vchSig) const;
//! Derive BIP32 child key.
- bool Derive(CKey& keyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const;
+ bool Derive(CKey& keyChild, ChainCode &ccChild, unsigned int nChild, const ChainCode& cc) const;
/**
* Verify thoroughly whether a private key and a public key match.
@@ -157,13 +155,13 @@ struct CExtKey {
unsigned char nDepth;
unsigned char vchFingerprint[4];
unsigned int nChild;
- unsigned char vchChainCode[32];
+ ChainCode chaincode;
CKey key;
friend bool operator==(const CExtKey& a, const CExtKey& b)
{
return a.nDepth == b.nDepth && memcmp(&a.vchFingerprint[0], &b.vchFingerprint[0], 4) == 0 && a.nChild == b.nChild &&
- memcmp(&a.vchChainCode[0], &b.vchChainCode[0], 32) == 0 && a.key == b.key;
+ a.chaincode == b.chaincode && a.key == b.key;
}
void Encode(unsigned char code[74]) const;
@@ -173,7 +171,13 @@ struct CExtKey {
void SetMaster(const unsigned char* seed, unsigned int nSeedLen);
};
-/** Check that required EC support is available at runtime */
+/** Initialize the elliptic curve support. May not be called twice without calling ECC_Stop first. */
+void ECC_Start(void);
+
+/** Deinitialize the elliptic curve support. No-op if ECC_Start wasn't called first. */
+void ECC_Stop(void);
+
+/** Check that required EC support is available at runtime. */
bool ECC_InitSanityCheck(void);
#endif // BITCOIN_KEY_H