mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-02 19:26:41 +00:00
SHA512 using libcrypto (not enabled by default)
This commit is contained in:
parent
610e594a50
commit
a59912f3af
@ -28,6 +28,20 @@ void SHA512::hash(void *digest,const void *data,unsigned int len)
|
|||||||
}
|
}
|
||||||
#endif
|
#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
|
#ifndef ZT_HAVE_NATIVE_SHA512
|
||||||
|
|
||||||
namespace ZeroTier {
|
namespace ZeroTier {
|
||||||
|
Loading…
Reference in New Issue
Block a user