SHA512 using libcrypto (not enabled by default)

This commit is contained in:
Adam Ierymenko 2018-03-12 16:56:47 -07:00
parent 610e594a50
commit a59912f3af

View File

@ -28,6 +28,20 @@ void SHA512::hash(void *digest,const void *data,unsigned int len)
}
#endif
#ifdef ZT_USE_LIBCRYPTO
#include <openssl/sha.h>
#define ZT_HAVE_NATIVE_SHA512
namespace ZeroTier {
void SHA512::hash(void *digest,const void *data,unsigned int len)
{
SHA512_CTX ctx;
SHA512_Init(&ctx);
SHA512_Update(&ctx,data,len);
SHA512_Final(reinterpret_cast<unsigned char *>(digest),&ctx);
}
}
#endif
#ifndef ZT_HAVE_NATIVE_SHA512
namespace ZeroTier {