| 282 | } |
| 283 | |
| 284 | void 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 | |
| 296 | CExtPubKey CExtKey::Neuter() const { |
| 297 | CExtPubKey ret; |