Changeset View
Changeset View
Standalone View
Standalone View
src/key.h
Show First 20 Lines • Show All 164 Lines • ▼ Show 20 Lines | friend bool operator==(const CExtKey &a, const CExtKey &b) { | ||||
a.nChild == b.nChild && a.chaincode == b.chaincode && | a.nChild == b.nChild && a.chaincode == b.chaincode && | ||||
a.key == b.key; | a.key == b.key; | ||||
} | } | ||||
void Encode(uint8_t code[BIP32_EXTKEY_SIZE]) const; | void Encode(uint8_t code[BIP32_EXTKEY_SIZE]) const; | ||||
void Decode(const uint8_t code[BIP32_EXTKEY_SIZE]); | void Decode(const uint8_t code[BIP32_EXTKEY_SIZE]); | ||||
bool Derive(CExtKey &out, unsigned int nChild) const; | bool Derive(CExtKey &out, unsigned int nChild) const; | ||||
CExtPubKey Neuter() const; | CExtPubKey Neuter() const; | ||||
void SetMaster(const uint8_t *seed, unsigned int nSeedLen); | void SetSeed(const uint8_t *seed, unsigned int nSeedLen); | ||||
template <typename Stream> void Serialize(Stream &s) const { | template <typename Stream> void Serialize(Stream &s) const { | ||||
unsigned int len = BIP32_EXTKEY_SIZE; | unsigned int len = BIP32_EXTKEY_SIZE; | ||||
::WriteCompactSize(s, len); | ::WriteCompactSize(s, len); | ||||
uint8_t code[BIP32_EXTKEY_SIZE]; | uint8_t code[BIP32_EXTKEY_SIZE]; | ||||
Encode(code); | Encode(code); | ||||
s.write((const char *)&code[0], len); | s.write((const char *)&code[0], len); | ||||
} | } | ||||
template <typename Stream> void Unserialize(Stream &s) { | template <typename Stream> void Unserialize(Stream &s) { | ||||
Show All 27 Lines |