From 02f336918547b93b4c03d608eafdf62de5d0a786 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Sun, 15 Sep 2013 11:02:53 -0400 Subject: Small amount of crypto cleanup. --- node/SHA512.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'node/SHA512.cpp') 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 #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)))) -- cgit v1.2.3