| 387 | } |
| 388 | |
| 389 | void CExtKey::Decode(const unsigned char code[BIP32_EXTKEY_SIZE]) { |
| 390 | nDepth = code[0]; |
| 391 | memcpy(vchFingerprint, code+1, 4); |
| 392 | nChild = ReadBE32(code+5); |
| 393 | memcpy(chaincode.begin(), code+9, 32); |
| 394 | key.Set(code+42, code+BIP32_EXTKEY_SIZE, true); |
| 395 | if ((nDepth == 0 && (nChild != 0 || ReadLE32(vchFingerprint) != 0)) || code[41] != 0) key = CKey(); |
| 396 | } |
| 397 | |
| 398 | bool ECC_InitSanityCheck() { |
| 399 | CKey key; |