| 315 | } |
| 316 | |
| 317 | void CExtKey::Encode(unsigned char code[BIP32_EXTKEY_SIZE]) const { |
| 318 | code[0] = nDepth; |
| 319 | memcpy(code+1, vchFingerprint, 4); |
| 320 | code[5] = (nChild >> 24) & 0xFF; code[6] = (nChild >> 16) & 0xFF; |
| 321 | code[7] = (nChild >> 8) & 0xFF; code[8] = (nChild >> 0) & 0xFF; |
| 322 | memcpy(code+9, chaincode.begin(), 32); |
| 323 | code[41] = 0; |
| 324 | assert(key.size() == 32); |
| 325 | memcpy(code+42, key.begin(), 32); |
| 326 | } |
| 327 | |
| 328 | void CExtKey::Decode(const unsigned char code[BIP32_EXTKEY_SIZE]) { |
| 329 | nDepth = code[0]; |
no test coverage detected