MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / SetMaster

Method SetMaster

src/key.cpp:255–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253}
254
255void CExtKey::SetMaster(const unsigned char *seed, unsigned int nSeedLen) {
256 static const unsigned char hashkey[] = {'B','i','t','c','o','i','n',' ','s','e','e','d'};
257 unsigned char out[64];
258 LockObject(out);
259 CHMAC_SHA512(hashkey, sizeof(hashkey)).Write(seed, nSeedLen).Finalize(out);
260 key.Set(&out[0], &out[32], true);
261 memcpy(chaincode.begin(), &out[32], 32);
262 UnlockObject(out);
263 nDepth = 0;
264 nChild = 0;
265 memset(vchFingerprint, 0, sizeof(vchFingerprint));
266}
267
268CExtPubKey CExtKey::Neuter() const {
269 CExtPubKey ret;

Callers 1

RunTestFunction · 0.80

Calls 8

LockObjectFunction · 0.85
CHMAC_SHA512Class · 0.85
memcpyFunction · 0.85
UnlockObjectFunction · 0.85
FinalizeMethod · 0.45
WriteMethod · 0.45
SetMethod · 0.45
beginMethod · 0.45

Tested by 1

RunTestFunction · 0.64