MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / BIP32Hash

Function BIP32Hash

src/hash.cpp:75–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75void BIP32Hash(const ChainCode &chainCode, unsigned int nChild, unsigned char header, const unsigned char data[32], unsigned char output[64])
76{
77 unsigned char num[4];
78 num[0] = (nChild >> 24) & 0xFF;
79 num[1] = (nChild >> 16) & 0xFF;
80 num[2] = (nChild >> 8) & 0xFF;
81 num[3] = (nChild >> 0) & 0xFF;
82 CHMAC_SHA512(chainCode.begin(), chainCode.size()).Write(&header, 1).Write(data, 32).Write(num, 4).Finalize(output);
83}
84
85#define ROTL(x, b) (uint64_t)(((x) << (b)) | ((x) >> (64 - (b))))
86

Callers 2

DeriveMethod · 0.85
DeriveMethod · 0.85

Calls 5

CHMAC_SHA512Class · 0.85
FinalizeMethod · 0.45
WriteMethod · 0.45
beginMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected