summaryrefslogtreecommitdiff
path: root/node/SHA512.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-09-24 11:00:22 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-09-24 11:00:22 -0700
commitfbde40d1fc8767e4b6e9fcf0b078a8a4eb0646bd (patch)
treee6776e96db9f90e985ac86c9967d7d945033328a /node/SHA512.cpp
parent557c0c29b0781ff6190189fc080075b1c773f382 (diff)
parent0e5aac6a117c28fde63f4cdb94e6c9fc415ca098 (diff)
downloadinfinitytier-fbde40d1fc8767e4b6e9fcf0b078a8a4eb0646bd.tar.gz
infinitytier-fbde40d1fc8767e4b6e9fcf0b078a8a4eb0646bd.zip
Merge branch 'adamierymenko-dev' into netcon
Diffstat (limited to 'node/SHA512.cpp')
-rw-r--r--node/SHA512.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/node/SHA512.cpp b/node/SHA512.cpp
index 197d6323..ddff4839 100644
--- a/node/SHA512.cpp
+++ b/node/SHA512.cpp
@@ -48,10 +48,8 @@ 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)))
+#ifdef ZT_NO_TYPE_PUNNING
-#if 0
static uint64 load_bigendian(const unsigned char *x)
{
return
@@ -77,7 +75,13 @@ static void store_bigendian(unsigned char *x,uint64 u)
x[1] = u; u >>= 8;
x[0] = u;
}
-#endif
+
+#else // !ZT_NO_TYPE_PUNNING
+
+#define load_bigendian(x) Utils::ntoh(*((const uint64_t *)(x)))
+#define store_bigendian(x,u) (*((uint64_t *)(x)) = Utils::hton((u)))
+
+#endif // ZT_NO_TYPE_PUNNING
#define SHR(x,c) ((x) >> (c))
#define ROTR(x,c) (((x) >> (c)) | ((x) << (64 - (c))))