68 if (pubkey[0] == 0x02 || pubkey[0] == 0x03) {
71 }
else if (pubkey[0] == 0x04) {
72 out[0] = 0x04 | (pubkey[64] & 0x01);
81 if (nSize == 0 || nSize == 1)
83 if (nSize == 2 || nSize == 3 || nSize == 4 || nSize == 5)
117 unsigned char vch[33] = {};
119 memcpy(&vch[1], &in[0], 32);
120 CPubKey pubkey(&vch[0], &vch[33]);
123 assert(pubkey.
size() == 65);
147 while (((
n % 10) == 0) && e < 9) {
153 assert(d >= 1 && d <= 9);
155 return 1 + (
n*9 + d - 1)*10 + e;
157 return 1 + (
n - 1)*10 + 9;
bool Compress(std::vector< unsigned char > &out) const
void resize(size_type new_size)
bool IsToPubKey(CPubKey &pubkey) const
unsigned int GetSpecialSize(unsigned int nSize) const
unsigned int size() const
Simple read-only vector-like interface to the pubkey data.
bool IsToKeyID(CKeyID &hash) const
bool IsFullyValid() const
fully validate whether this is a valid public key (more expensive than IsValid()) ...
bool Decompress(unsigned int nSize, const std::vector< unsigned char > &out)
static uint64_t CompressAmount(uint64_t nAmount)
bool Decompress()
Turn this public key into an uncompressed public key.
const unsigned char * begin() const
void Set(const T pbegin, const T pend)
Initialize a public key using begin/end iterators to byte data.
static uint64_t DecompressAmount(uint64_t nAmount)
void * memcpy(void *a, const void *b, size_t c)
bool IsToScriptID(CScriptID &hash) const