From 6bfe6761d8ebea8bdaaccff1760aeb8f3328d790 Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 26 Sep 2019 11:49:33 -0700 Subject: [PATCH] Disable the new hashing aligned build option by default. Does not increase performance... the memcpy is faster than the alignment check on modern CPU's. Embedded systems may benefit from this though, so leaving support for it in place. --- wolfcrypt/src/md5.c | 6 ------ wolfcrypt/src/sha.c | 6 ------ wolfcrypt/src/sha256.c | 8 -------- 3 files changed, 20 deletions(-) diff --git a/wolfcrypt/src/md5.c b/wolfcrypt/src/md5.c index 1b5a86e6e..9a18720f8 100644 --- a/wolfcrypt/src/md5.c +++ b/wolfcrypt/src/md5.c @@ -154,14 +154,8 @@ static int Transform_Len(wc_Md5* md5, const byte* data, word32 len) #define HAVE_MD5_CUST_API #else #define NEED_SOFT_MD5 - #endif /* End Hardware Acceleration */ -#ifndef WC_MD5_DATA_ALIGNMENT - /* default to 32-bit alignement */ - #define WC_MD5_DATA_ALIGNMENT 4 -#endif - #ifdef NEED_SOFT_MD5 #define XTRANSFORM(S,B) Transform((S),(B)) diff --git a/wolfcrypt/src/sha.c b/wolfcrypt/src/sha.c index a601e9e28..dd51bd002 100644 --- a/wolfcrypt/src/sha.c +++ b/wolfcrypt/src/sha.c @@ -326,14 +326,8 @@ return ret; } - #endif /* End Hardware Acceleration */ -#ifndef WC_SHA_DATA_ALIGNMENT - /* default to 32-bit alignement */ - #define WC_SHA_DATA_ALIGNMENT 4 -#endif - /* Software implementation */ #ifdef USE_SHA_SOFTWARE_IMPL diff --git a/wolfcrypt/src/sha256.c b/wolfcrypt/src/sha256.c index 23dbbc410..d8d43662f 100644 --- a/wolfcrypt/src/sha256.c +++ b/wolfcrypt/src/sha256.c @@ -201,9 +201,6 @@ static int InitSha256(wc_Sha256* sha256) /* in case intel instructions aren't available, plus we need the K[] global */ #define NEED_SOFT_SHA256 - /* requires 128-bit alignment */ - #define WC_SHA256_DATA_ALIGNMENT 16 - /***** Intel AVX1/AVX2 Macro Control Structure @@ -614,11 +611,6 @@ static int InitSha256(wc_Sha256* sha256) } #endif /* End Hardware Acceleration */ -#ifndef WC_SHA256_DATA_ALIGNMENT - /* default is 32-bit alignment required */ - #define WC_SHA256_DATA_ALIGNMENT 4 -#endif - #ifdef NEED_SOFT_SHA256 static const ALIGN32 word32 K[64] = {