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

Method SetSeed

src/key.cpp:296–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296void CExtKey::SetSeed(const unsigned char *seed, unsigned int nSeedLen) {
297 static const unsigned char hashkey[] = {'B','i','t','c','o','i','n',' ','s','e','e','d'};
298 std::vector<unsigned char, secure_allocator<unsigned char>> vout(64);
299 CHMAC_SHA512(hashkey, sizeof(hashkey)).Write(seed, nSeedLen).Finalize(vout.data());
300 key.Set(vout.data(), vout.data() + 32, true);
301 memcpy(chaincode.begin(), vout.data() + 32, 32);
302 nDepth = 0;
303 nChild = 0;
304 memset(vchFingerprint, 0, sizeof(vchFingerprint));
305}
306
307CExtPubKey CExtKey::Neuter() const {
308 CExtPubKey ret;

Callers 4

AddKeypathToMapFunction · 0.80
dumpwalletFunction · 0.80
DeriveNewChildKeyMethod · 0.80
RunTestFunction · 0.80

Calls 7

CHMAC_SHA512Class · 0.85
memcpyFunction · 0.85
FinalizeMethod · 0.45
WriteMethod · 0.45
dataMethod · 0.45
SetMethod · 0.45
beginMethod · 0.45

Tested by 1

RunTestFunction · 0.64