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

Function BIP32Hash

src/hash.cpp:71–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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