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

Method SetSeed

src/key.cpp:368–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

366}
367
368void CExtKey::SetSeed(std::span<const std::byte> seed)
369{
370 static const unsigned char hashkey[] = {'B','i','t','c','o','i','n',' ','s','e','e','d'};
371 std::vector<unsigned char, secure_allocator<unsigned char>> vout(64);
372 CHMAC_SHA512{hashkey, sizeof(hashkey)}.Write(UCharCast(seed.data()), seed.size()).Finalize(vout.data());
373 key.Set(vout.data(), vout.data() + 32, true);
374 memcpy(chaincode.begin(), vout.data() + 32, 32);
375 nDepth = 0;
376 nChild = 0;
377 memset(vchFingerprint, 0, sizeof(vchFingerprint));
378}
379
380CExtPubKey CExtKey::Neuter() const {
381 CExtPubKey ret;

Callers

nothing calls this directly

Calls 7

UCharCastFunction · 0.85
FinalizeMethod · 0.45
WriteMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
SetMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected