| 285 | } |
| 286 | |
| 287 | void CExtKey::SetMaster(const uint8_t *seed, uint32_t nSeedLen) { |
| 288 | static const char hashkey[] = {'B', 'i', 't', 'c', 'o', 'i', 'n', ' ', 's', 'e', 'e', 'd'}; |
| 289 | HMAC_SHA512_CTX ctx; |
| 290 | HMAC_SHA512_Init(&ctx, hashkey, sizeof(hashkey)); |
| 291 | HMAC_SHA512_Update(&ctx, seed, nSeedLen); |
| 292 | uint8_t out[64]; |
| 293 | LockObject(out); |
| 294 | HMAC_SHA512_Final(out, &ctx); |
| 295 | key.Set(&out[0], &out[32], true); |
| 296 | memcpy(vchChainCode, &out[32], 32); |
| 297 | UnlockObject(out); |
| 298 | nDepth = 0; |
| 299 | nChild = 0; |
| 300 | memset(vchFingerprint, 0, sizeof(vchFingerprint)); |
| 301 | } |
| 302 | |
| 303 | CExtPubKey CExtKey::Neuter() const { |
| 304 | CExtPubKey ret; |
nothing calls this directly
no test coverage detected