Changeset View
Changeset View
Standalone View
Standalone View
src/key.h
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | |||||
public: | public: | ||||
//! Construct an invalid private key. | //! Construct an invalid private key. | ||||
CKey() : fValid(false), fCompressed(false) { | CKey() : fValid(false), fCompressed(false) { | ||||
// Important: vch must be 32 bytes in length to not break serialization | // Important: vch must be 32 bytes in length to not break serialization | ||||
keydata.resize(32); | keydata.resize(32); | ||||
} | } | ||||
//! Destructor (again necessary because of memlocking). | |||||
~CKey() {} | |||||
friend bool operator==(const CKey &a, const CKey &b) { | friend bool operator==(const CKey &a, const CKey &b) { | ||||
return a.fCompressed == b.fCompressed && a.size() == b.size() && | return a.fCompressed == b.fCompressed && a.size() == b.size() && | ||||
memcmp(a.keydata.data(), b.keydata.data(), a.size()) == 0; | memcmp(a.keydata.data(), b.keydata.data(), a.size()) == 0; | ||||
} | } | ||||
//! Initialize using begin and end iterators to byte data. | //! Initialize using begin and end iterators to byte data. | ||||
template <typename T> | template <typename T> | ||||
void Set(const T pbegin, const T pend, bool fCompressedIn) { | void Set(const T pbegin, const T pend, bool fCompressedIn) { | ||||
▲ Show 20 Lines • Show All 136 Lines • Show Last 20 Lines |