diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-12-30 06:57:34 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-12-31 01:56:19 +0100 |
commit | 0c2c0a846d42b05b44d62a3c3fcaf410660f8a4d (patch) | |
tree | edd8f33dae61b4d1ae304a1ef613b23186bc3dc8 /src/Crypto/Sha2.c | |
parent | d462806ea970434ab9f09748f74a86608e1fb31e (diff) | |
download | VeraCrypt-0c2c0a846d42b05b44d62a3c3fcaf410660f8a4d.tar.gz VeraCrypt-0c2c0a846d42b05b44d62a3c3fcaf410660f8a4d.zip |
Cryptography: Optimize Whirlpool implementation by using public domain assembly code developed by Wei Dai
Diffstat (limited to 'src/Crypto/Sha2.c')
-rw-r--r-- | src/Crypto/Sha2.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/Crypto/Sha2.c b/src/Crypto/Sha2.c index 98a9c01a..f1a9850a 100644 --- a/src/Crypto/Sha2.c +++ b/src/Crypto/Sha2.c @@ -69,6 +69,7 @@ */
#include "Common/Endian.h"
+#include "Crypto/misc.h"
#define PLATFORM_BYTE_ORDER BYTE_ORDER
#define IS_LITTLE_ENDIAN LITTLE_ENDIAN
@@ -89,18 +90,6 @@ extern "C" #pragma intrinsic(memcpy)
#endif
-#if 0 && defined(_MSC_VER)
-#define rotl32 _lrotl
-#define rotr32 _lrotr
-#else
-#define rotl32(x,n) (((x) << n) | ((x) >> (32 - n)))
-#define rotr32(x,n) (((x) >> n) | ((x) << (32 - n)))
-#endif
-
-#if !defined(bswap_32)
-#define bswap_32(x) ((rotr32((x), 24) & 0x00ff00ff) | (rotr32((x), 8) & 0xff00ff00))
-#endif
-
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
#define SWAP_BYTES
#else
@@ -427,12 +416,6 @@ VOID_RETURN sha256(unsigned char hval[], const unsigned char data[], unsigned lo #define SHA512_MASK (SHA512_BLOCK_SIZE - 1)
-#define rotr64(x,n) (((x) >> n) | ((x) << (64 - n)))
-
-#if !defined(bswap_64)
-#define bswap_64(x) (((uint_64t)(bswap_32((uint_32t)(x)))) << 32 | bswap_32((uint_32t)((x) >> 32)))
-#endif
-
#if defined(SWAP_BYTES)
#define bsw_64(p,n) \
{ int _i = (n); while(_i--) ((uint_64t*)p)[_i] = bswap_64(((uint_64t*)p)[_i]); }
|