Add a built-in SHA256/SHA512 implementation.

This also moves the HMAC-SHA512 implementation to sha2.cpp.
This commit is contained in:
Pieter Wuille
2014-04-20 17:36:25 +02:00
parent 540ce6aa10
commit 977cdadea8
8 changed files with 536 additions and 76 deletions

View File

@@ -126,14 +126,4 @@ inline uint160 Hash160(const std::vector<unsigned char>& vch)
unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector<unsigned char>& vDataToHash);
typedef struct
{
SHA512_CTX ctxInner;
SHA512_CTX ctxOuter;
} HMAC_SHA512_CTX;
int HMAC_SHA512_Init(HMAC_SHA512_CTX *pctx, const void *pkey, size_t len);
int HMAC_SHA512_Update(HMAC_SHA512_CTX *pctx, const void *pdata, size_t len);
int HMAC_SHA512_Final(unsigned char *pmd, HMAC_SHA512_CTX *pctx);
#endif