MCPcopy Create free account
hub / github.com/LUX-Core/lux / SetMaster

Method SetMaster

src/key.cpp:284–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282}
283
284void CExtKey::SetMaster(const unsigned char* seed, unsigned int nSeedLen) {
285 static const unsigned char hashkey[] = {'B', 'i', 't', 'c', 'o', 'i', 'n', ' ', 's', 'e', 'e', 'd'};
286 std::vector<unsigned char, secure_allocator<unsigned char>> vout(64);
287 CHMAC_SHA512(hashkey, sizeof(hashkey)).Write(seed, nSeedLen).Finalize(vout.data());
288 key.Set(vout.data(), vout.data() + 32, true);
289 memcpy(chaincode.begin(), vout.data() + 32, 32);
290
291 nDepth = 0;
292 nChild = 0;
293 memset(vchFingerprint, 0, sizeof(vchFingerprint));
294}
295
296CExtPubKey CExtKey::Neuter() const {
297 CExtPubKey ret;

Callers 4

DebugMethod · 0.80
DeriveChildExtKeyMethod · 0.80
dumpwalletFunction · 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