Adam Ierymenko 6 years ago
parent
commit
663376e385
1 changed files with 1 additions and 6 deletions
  1. 1 6
      node/SHA512.cpp

+ 1 - 6
node/SHA512.cpp

@@ -18,7 +18,6 @@ Public domain.
 #include <CommonCrypto/CommonDigest.h>
 #define ZT_HAVE_NATIVE_SHA512
 namespace ZeroTier {
-
 void SHA512(void *digest,const void *data,unsigned int len)
 {
 	CC_SHA512_CTX ctx;
@@ -26,7 +25,6 @@ void SHA512(void *digest,const void *data,unsigned int len)
 	CC_SHA512_Update(&ctx,data,len);
 	CC_SHA512_Final(reinterpret_cast<unsigned char *>(digest),&ctx);
 }
-
 void SHA384(void *digest,const void *data,unsigned int len)
 {
 	CC_SHA512_CTX ctx;
@@ -34,7 +32,6 @@ void SHA384(void *digest,const void *data,unsigned int len)
 	CC_SHA384_Update(&ctx,data,len);
 	CC_SHA384_Final(reinterpret_cast<unsigned char *>(digest),&ctx);
 }
-
 }
 #endif
 
@@ -42,7 +39,6 @@ void SHA384(void *digest,const void *data,unsigned int len)
 #include <openssl/sha.h>
 #define ZT_HAVE_NATIVE_SHA512
 namespace ZeroTier {
-
 void SHA512(void *digest,const void *data,unsigned int len)
 {
 	SHA512_CTX ctx;
@@ -50,7 +46,6 @@ void SHA512(void *digest,const void *data,unsigned int len)
 	SHA512_Update(&ctx,data,len);
 	SHA512_Final(reinterpret_cast<unsigned char *>(digest),&ctx);
 }
-
 void SHA384(void *digest,const void *data,unsigned int len)
 {
 	SHA512_CTX ctx;
@@ -58,10 +53,10 @@ void SHA384(void *digest,const void *data,unsigned int len)
 	SHA384_Update(&ctx,data,len);
 	SHA384_Final(reinterpret_cast<unsigned char *>(digest),&ctx);
 }
-
 }
 #endif
 
+// If a platform-native SHA512 isn't available we use this 64-bit C version.
 #ifndef ZT_HAVE_NATIVE_SHA512
 
 namespace ZeroTier {