VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Crypto/misc.h
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-06-02 00:10:39 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-06-02 00:12:00 +0200
commit76d3bc631eff60841026f2526d69f6d661d218a3 (patch)
treececc43976a8c45029b35b08ba3af0819ebee3993 /src/Crypto/misc.h
parent99c4031d89ce4f72e3899b3cac660082a1820a48 (diff)
downloadVeraCrypt-76d3bc631eff60841026f2526d69f6d661d218a3.tar.gz
VeraCrypt-76d3bc631eff60841026f2526d69f6d661d218a3.zip
Crypto: Add support for Japanese encryption standard Camellia, including for system encryption.
Diffstat (limited to 'src/Crypto/misc.h')
-rw-r--r--src/Crypto/misc.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Crypto/misc.h b/src/Crypto/misc.h
index 37d40243..2b4e9089 100644
--- a/src/Crypto/misc.h
+++ b/src/Crypto/misc.h
@@ -55,6 +55,24 @@
#endif
+#if _MSC_VER >= 1400 && !defined(__INTEL_COMPILER)
+// Intel C++ Compiler 10.0 calls a function instead of using the rotate instruction when using these instructions
+#pragma intrinsic(_rotr8,_rotl8,_rotr16,_rotl16)
+
+#define rotr8(x,n) _rotr8(x, n)
+#define rotl8(x,n) _rotl8(x, n)
+#define rotr16(x,n) _rotr16(x, n)
+#define rotl16(x,n) _rotl16(x, n)
+
+#else
+
+#define rotr8(x,n) (((x) >> n) | ((x) << (8 - n)))
+#define rotl8(x,n) (((x) << n) | ((x) >> (8 - n)))
+#define rotr16(x,n) (((x) >> n) | ((x) << (16 - n)))
+#define rotl16(x,n) (((x) << n) | ((x) >> (16 - n)))
+
+#endif
+
#if defined(__GNUC__) && defined(__linux__)
#define CRYPTOPP_BYTESWAP_AVAILABLE
#include <byteswap.h>