Changeset View
Changeset View
Standalone View
Standalone View
src/pubkey.h
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | public: | ||||
//! Construct a public key from a byte vector. | //! Construct a public key from a byte vector. | ||||
explicit CPubKey(const std::vector<uint8_t> &_vch) { | explicit CPubKey(const std::vector<uint8_t> &_vch) { | ||||
Set(_vch.begin(), _vch.end()); | 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 *data() const { return vch; } | |||||
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. | ||||
friend bool operator==(const CPubKey &a, const CPubKey &b) { | friend bool operator==(const CPubKey &a, const CPubKey &b) { | ||||
return a.vch[0] == b.vch[0] && memcmp(a.vch, b.vch, a.size()) == 0; | return a.vch[0] == b.vch[0] && memcmp(a.vch, b.vch, a.size()) == 0; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 139 Lines • Show Last 20 Lines |