mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
boost: moveonly: move BIP32Hash to hash.h
This commit is contained in:
13
src/hash.cpp
13
src/hash.cpp
@@ -63,3 +63,16 @@ unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector<unsigned char
|
||||
|
||||
return h1;
|
||||
}
|
||||
|
||||
void BIP32Hash(const unsigned char chainCode[32], unsigned int nChild, unsigned char header, const unsigned char data[32], unsigned char output[64])
|
||||
{
|
||||
unsigned char num[4];
|
||||
num[0] = (nChild >> 24) & 0xFF;
|
||||
num[1] = (nChild >> 16) & 0xFF;
|
||||
num[2] = (nChild >> 8) & 0xFF;
|
||||
num[3] = (nChild >> 0) & 0xFF;
|
||||
CHMAC_SHA512(chainCode, 32).Write(&header, 1)
|
||||
.Write(data, 32)
|
||||
.Write(num, 4)
|
||||
.Finalize(output);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user