| 253 | } |
| 254 | |
| 255 | void 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 | |
| 268 | CExtPubKey CExtKey::Neuter() const { |
| 269 | CExtPubKey ret; |