VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Crypto/misc.h
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-06-17 14:16:57 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-06-17 15:50:46 +0200
commit6ae982cccf42a54cef60f5948aa46604859b4871 (patch)
treec5dcfb42e8ffb9dba77c944bb3498f53c4e275f7 /src/Crypto/misc.h
parent842dce0e1b82a55123718384b41168d2253cd710 (diff)
downloadVeraCrypt-6ae982cccf42a54cef60f5948aa46604859b4871.tar.gz
VeraCrypt-6ae982cccf42a54cef60f5948aa46604859b4871.zip
Update intrinsic support and cpu detection.
Diffstat (limited to 'src/Crypto/misc.h')
-rw-r--r--src/Crypto/misc.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Crypto/misc.h b/src/Crypto/misc.h
index 2b4e9089..75ecedcd 100644
--- a/src/Crypto/misc.h
+++ b/src/Crypto/misc.h
@@ -87,10 +87,12 @@
#define bswap_32 OSSwapInt32
#define bswap_64 OSSwapInt64
#else
-#ifdef CRYPTOPP_FAST_ROTATE(32)
+#if CRYPTOPP_FAST_ROTATE(32)
#define bswap_32(x) (rotr32((x), 8U) & 0xff00ff00) | (rotl32((x), 8U) & 0x00ff00ff)
#else
+#define CRYPTOPP_BYTESWAP_AVAILABLE
#define bswap_32(x) (rotl32((((x) & 0xFF00FF00) >> 8) | (((x) & 0x00FF00FF) << 8), 16U))
+#define bswap_64(x) rotl64(((((((x & LL(0xFF00FF00FF00FF00)) >> 8) | ((x & LL(0x00FF00FF00FF00FF)) << 8)) & LL(0xFFFF0000FFFF0000)) >> 16) | (((((x & LL(0xFF00FF00FF00FF00)) >> 8) | ((x & LL(0x00FF00FF00FF00FF)) << 8)) & LL(0x0000FFFF0000FFFF)) << 16)), 32U)
#endif
#ifndef TC_NO_COMPILER_INT64
#define bswap_64(x) rotl64(((((((x & LL(0xFF00FF00FF00FF00)) >> 8) | ((x & LL(0x00FF00FF00FF00FF)) << 8)) & LL(0xFFFF0000FFFF0000)) >> 16) | (((((x & LL(0xFF00FF00FF00FF00)) >> 8) | ((x & LL(0x00FF00FF00FF00FF)) << 8)) & LL(0x0000FFFF0000FFFF)) << 16)), 32U)