diff options
| author | Roy Badami <[email protected]> | 2014-07-07 22:06:21 +0100 |
|---|---|---|
| committer | Roy Badami <[email protected]> | 2014-07-07 22:06:21 +0100 |
| commit | 96df327834af3b55918adfac9b3f65adfc960b3a (patch) | |
| tree | 8bd199df46ea6f39f7094c0e7db2185b4d3f5d6d /src/hash.cpp | |
| parent | Show bitcoin quantities with full precision, even in the presence of trailing... (diff) | |
| parent | Merge pull request #4480 (diff) | |
| download | discoin-96df327834af3b55918adfac9b3f65adfc960b3a.tar.xz discoin-96df327834af3b55918adfac9b3f65adfc960b3a.zip | |
Merge remote-tracking branch 'upstream/master'
Conflicts:
src/qt/overviewpage.cpp
src/qt/transactiondesc.cpp
Diffstat (limited to 'src/hash.cpp')
| -rw-r--r-- | src/hash.cpp | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/hash.cpp b/src/hash.cpp index 7b054bd15..bddd8abf3 100644 --- a/src/hash.cpp +++ b/src/hash.cpp @@ -56,44 +56,3 @@ unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector<unsigned char return h1; } - -int HMAC_SHA512_Init(HMAC_SHA512_CTX *pctx, const void *pkey, size_t len) -{ - unsigned char key[128]; - if (len <= 128) - { - memcpy(key, pkey, len); - memset(key + len, 0, 128-len); - } - else - { - SHA512_CTX ctxKey; - SHA512_Init(&ctxKey); - SHA512_Update(&ctxKey, pkey, len); - SHA512_Final(key, &ctxKey); - memset(key + 64, 0, 64); - } - - for (int n=0; n<128; n++) - key[n] ^= 0x5c; - SHA512_Init(&pctx->ctxOuter); - SHA512_Update(&pctx->ctxOuter, key, 128); - - for (int n=0; n<128; n++) - key[n] ^= 0x5c ^ 0x36; - SHA512_Init(&pctx->ctxInner); - return SHA512_Update(&pctx->ctxInner, key, 128); -} - -int HMAC_SHA512_Update(HMAC_SHA512_CTX *pctx, const void *pdata, size_t len) -{ - return SHA512_Update(&pctx->ctxInner, pdata, len); -} - -int HMAC_SHA512_Final(unsigned char *pmd, HMAC_SHA512_CTX *pctx) -{ - unsigned char buf[64]; - SHA512_Final(buf, &pctx->ctxInner); - SHA512_Update(&pctx->ctxOuter, buf, 64); - return SHA512_Final(pmd, &pctx->ctxOuter); -} |