MCPcopy Create free account
hub / github.com/ElementsProject/elements / Encode

Method Encode

src/pubkey.cpp:361–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359}
360
361void CExtPubKey::Encode(unsigned char code[BIP32_EXTKEY_SIZE]) const {
362 code[0] = nDepth;
363 memcpy(code+1, vchFingerprint, 4);
364 WriteBE32(code+5, nChild);
365 memcpy(code+9, chaincode.begin(), 32);
366 assert(pubkey.size() == CPubKey::COMPRESSED_SIZE);
367 memcpy(code+41, pubkey.begin(), CPubKey::COMPRESSED_SIZE);
368}
369
370void CExtPubKey::Decode(const unsigned char code[BIP32_EXTKEY_SIZE]) {
371 nDepth = code[0];

Callers

nothing calls this directly

Calls 3

WriteBE32Function · 0.50
beginMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected