MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / Decode

Method Decode

src/pubkey.cpp:371–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371CPubKey EllSwiftPubKey::Decode() const
372{
373 secp256k1_pubkey pubkey;
374 secp256k1_ellswift_decode(secp256k1_context_static, &pubkey, UCharCast(m_pubkey.data()));
375
376 size_t sz = CPubKey::COMPRESSED_SIZE;
377 std::array<uint8_t, CPubKey::COMPRESSED_SIZE> vch_bytes;
378
379 secp256k1_ec_pubkey_serialize(secp256k1_context_static, vch_bytes.data(), &sz, &pubkey, SECP256K1_EC_COMPRESSED);
380 assert(sz == vch_bytes.size());
381
382 return CPubKey{vch_bytes.begin(), vch_bytes.end()};
383}
384
385void CExtPubKey::Encode(unsigned char code[BIP32_EXTKEY_SIZE]) const {
386 code[0] = nDepth;

Callers

nothing calls this directly

Calls 12

UCharCastFunction · 0.85
ReadBE32Function · 0.85
ReadLE32Function · 0.85
IsFullyValidMethod · 0.80
CPubKeyClass · 0.70
dataMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected