Changeset View
Changeset View
Standalone View
Standalone View
src/pubkey.h
Show All 25 Lines | |||||
*/ | */ | ||||
const unsigned int BIP32_EXTKEY_SIZE = 74; | const unsigned int BIP32_EXTKEY_SIZE = 74; | ||||
/** A reference to a CKey: the Hash160 of its serialized public key */ | /** A reference to a CKey: the Hash160 of its serialized public key */ | ||||
class CKeyID : public uint160 { | class CKeyID : public uint160 { | ||||
public: | public: | ||||
CKeyID() : uint160() {} | CKeyID() : uint160() {} | ||||
CKeyID(const uint160 &in) : uint160(in) {} | explicit CKeyID(const uint160 &in) : uint160(in) {} | ||||
}; | }; | ||||
typedef uint256 ChainCode; | typedef uint256 ChainCode; | ||||
/** An encapsulated public key. */ | /** An encapsulated public key. */ | ||||
class CPubKey { | class CPubKey { | ||||
private: | private: | ||||
/** | /** | ||||
Show All 26 Lines | public: | ||||
} | } | ||||
//! Construct a public key using begin/end iterators to byte data. | //! Construct a public key using begin/end iterators to byte data. | ||||
template <typename T> CPubKey(const T pbegin, const T pend) { | template <typename T> CPubKey(const T pbegin, const T pend) { | ||||
Set(pbegin, pend); | Set(pbegin, pend); | ||||
} | } | ||||
//! Construct a public key from a byte vector. | //! Construct a public key from a byte vector. | ||||
CPubKey(const std::vector<uint8_t> &_vch) { Set(_vch.begin(), _vch.end()); } | explicit CPubKey(const std::vector<uint8_t> &_vch) { | ||||
Set(_vch.begin(), _vch.end()); | |||||
} | |||||
//! Simple read-only vector-like interface to the pubkey data. | //! Simple read-only vector-like interface to the pubkey data. | ||||
unsigned int size() const { return GetLen(vch[0]); } | unsigned int size() const { return GetLen(vch[0]); } | ||||
const uint8_t *begin() const { return vch; } | const uint8_t *begin() const { return vch; } | ||||
const uint8_t *end() const { return vch + size(); } | const uint8_t *end() const { return vch + size(); } | ||||
const uint8_t &operator[](unsigned int pos) const { return vch[pos]; } | const uint8_t &operator[](unsigned int pos) const { return vch[pos]; } | ||||
//! Comparator implementation. | //! Comparator implementation. | ||||
▲ Show 20 Lines • Show All 131 Lines • Show Last 20 Lines |