summaryrefslogtreecommitdiff
path: root/node/SHA512.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-09-15 11:02:53 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-09-15 11:02:53 -0400
commit02f336918547b93b4c03d608eafdf62de5d0a786 (patch)
tree801c25da5a4dc7bbb157d98fc2fd882b3a1441d0 /node/SHA512.cpp
parent300d26973a56b4b544fb4a29ec134fd600976d98 (diff)
downloadinfinitytier-02f336918547b93b4c03d608eafdf62de5d0a786.tar.gz
infinitytier-02f336918547b93b4c03d608eafdf62de5d0a786.zip
Small amount of crypto cleanup.
Diffstat (limited to 'node/SHA512.cpp')
-rw-r--r--node/SHA512.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/node/SHA512.cpp b/node/SHA512.cpp
index b9700109..9d6fbd95 100644
--- a/node/SHA512.cpp
+++ b/node/SHA512.cpp
@@ -30,6 +30,7 @@
#include <string.h>
#include "SHA512.hpp"
+#include "Utils.hpp"
namespace ZeroTier {
@@ -47,6 +48,10 @@ Public domain.
#define uint64 uint64_t
+#define load_bigendian(x) Utils::ntoh(*((const uint64_t *)(x)))
+#define store_bigendian(x,u) (*((uint64_t *)(x)) = Utils::hton((u)))
+
+#if 0
static uint64 load_bigendian(const unsigned char *x)
{
return
@@ -72,6 +77,7 @@ static void store_bigendian(unsigned char *x,uint64 u)
x[1] = u; u >>= 8;
x[0] = u;
}
+#endif
#define SHR(x,c) ((x) >> (c))
#define ROTR(x,c) (((x) >> (c)) | ((x) << (64 - (c))))