diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-06-02 00:10:39 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-06-02 00:12:00 +0200 |
commit | 76d3bc631eff60841026f2526d69f6d661d218a3 (patch) | |
tree | cecc43976a8c45029b35b08ba3af0819ebee3993 /src/Crypto/misc.h | |
parent | 99c4031d89ce4f72e3899b3cac660082a1820a48 (diff) | |
download | VeraCrypt-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.h | 18 |
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> |