From 0c2c0a846d42b05b44d62a3c3fcaf410660f8a4d Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 30 Dec 2015 06:57:34 +0100 Subject: Cryptography: Optimize Whirlpool implementation by using public domain assembly code developed by Wei Dai --- src/Crypto/Sha2.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'src/Crypto/Sha2.c') 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]); } -- cgit v1.2.3