diff options
author | Jeremy Rubin <j@rubin.io> | 2020-02-05 11:57:32 -0800 |
---|---|---|
committer | Jeremy Rubin <j@rubin.io> | 2020-08-06 16:28:26 -0700 |
commit | 6510d0ff4173a7b01d6728051303c7c38eb34533 (patch) | |
tree | 43d18ecb40cf20a459a03553b946fc2fc5aaf40d /src/hash.cpp | |
parent | b475d7d0fa000d5802caf3065b8b2abcea60719b (diff) |
Add SHA256Uint256 helper functions
Diffstat (limited to 'src/hash.cpp')
-rw-r--r-- | src/hash.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/hash.cpp b/src/hash.cpp index 4c09f5f646..83b90ae063 100644 --- a/src/hash.cpp +++ b/src/hash.cpp @@ -77,3 +77,10 @@ void BIP32Hash(const ChainCode &chainCode, unsigned int nChild, unsigned char he num[3] = (nChild >> 0) & 0xFF; CHMAC_SHA512(chainCode.begin(), chainCode.size()).Write(&header, 1).Write(data, 32).Write(num, 4).Finalize(output); } + +uint256 SHA256Uint256(const uint256& input) +{ + uint256 result; + CSHA256().Write(input.begin(), 32).Finalize(result.begin()); + return result; +} |