10inline uint32_t
ROTL32(uint32_t x, int8_t r) {
11 return (x << r) | (x >> (32 - r));
17 uint32_t h1 = nHashSeed;
18 const uint32_t c1 = 0xcc9e2d51;
19 const uint32_t c2 = 0x1b873593;
21 const int nblocks = vDataToHash.
size() / 4;
25 const uint8_t *blocks = vDataToHash.
data();
27 for (
int i = 0; i < nblocks; ++i) {
36 h1 = h1 * 5 + 0xe6546b64;
41 const uint8_t *tail = vDataToHash.
data() + nblocks * 4;
45 switch (vDataToHash.
size() & 3) {
62 h1 ^= vDataToHash.
size();
73 const uint8_t data[32], uint8_t output[64]) {
75 num[0] = (nChild >> 24) & 0xFF;
76 num[1] = (nChild >> 16) & 0xFF;
77 num[2] = (nChild >> 8) & 0xFF;
78 num[3] = (nChild >> 0) & 0xFF;
static const uint8_t k1[32]
A hasher class for HMAC-SHA-512.
CHMAC_SHA512 & Write(const uint8_t *data, size_t len)
void Finalize(uint8_t hash[OUTPUT_SIZE])
constexpr std::size_t size() const noexcept
constexpr C * data() const noexcept
unsigned int size() const
static uint32_t ReadLE32(const uint8_t *ptr)
uint32_t MurmurHash3(uint32_t nHashSeed, Span< const uint8_t > vDataToHash)
void BIP32Hash(const ChainCode &chainCode, uint32_t nChild, uint8_t header, const uint8_t data[32], uint8_t output[64])
uint32_t ROTL32(uint32_t x, int8_t r)