mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 02:37:28 +02:00
Adjusted the alignement macro to use WC_HASH_DATA_ALIGNMENT
for shared settings across hash algos.
This commit is contained in:
@ -379,8 +379,8 @@ int wc_Md5Update(wc_Md5* md5, const byte* data, word32 len)
|
||||
while (len >= WC_MD5_BLOCK_SIZE) {
|
||||
/* optimization to avoid memcpy if data pointer is properly aligned */
|
||||
/* Big Endian requires byte swap, so can't use data directly */
|
||||
#if defined(WC_MD5_DATA_ALIGNMENT) && !defined(BIG_ENDIAN_ORDER)
|
||||
if (((size_t)data % WC_MD5_DATA_ALIGNMENT) == 0) {
|
||||
#if defined(WC_HASH_DATA_ALIGNMENT) && !defined(BIG_ENDIAN_ORDER)
|
||||
if (((size_t)data % WC_HASH_DATA_ALIGNMENT) == 0) {
|
||||
local32 = (word32*)data;
|
||||
}
|
||||
else
|
||||
|
@ -576,8 +576,8 @@ int wc_ShaUpdate(wc_Sha* sha, const byte* data, word32 len)
|
||||
while (len >= WC_SHA_BLOCK_SIZE) {
|
||||
/* optimization to avoid memcpy if data pointer is properly aligned */
|
||||
/* Little Endian requires byte swap, so can't use data directly */
|
||||
#if defined(WC_SHA_DATA_ALIGNMENT) && !defined(LITTLE_ENDIAN_ORDER)
|
||||
if (((size_t)data % WC_SHA_DATA_ALIGNMENT) == 0) {
|
||||
#if defined(WC_HASH_DATA_ALIGNMENT) && !defined(LITTLE_ENDIAN_ORDER)
|
||||
if (((size_t)data % WC_HASH_DATA_ALIGNMENT) == 0) {
|
||||
local32 = (word32*)data;
|
||||
}
|
||||
else
|
||||
|
@ -900,9 +900,9 @@ static int InitSha256(wc_Sha256* sha256)
|
||||
/* optimization to avoid memcpy if data pointer is properly aligned */
|
||||
/* Intel transform function requires use of sha256->buffer */
|
||||
/* Little Endian requires byte swap, so can't use data directly */
|
||||
#if defined(WC_SHA256_DATA_ALIGNMENT) && !defined(LITTLE_ENDIAN_ORDER) && \
|
||||
#if defined(WC_HASH_DATA_ALIGNMENT) && !defined(LITTLE_ENDIAN_ORDER) && \
|
||||
!defined(HAVE_INTEL_AVX1) && !defined(HAVE_INTEL_AVX2)
|
||||
if (((size_t)data % WC_SHA256_DATA_ALIGNMENT) == 0) {
|
||||
if (((size_t)data % WC_HASH_DATA_ALIGNMENT) == 0) {
|
||||
local32 = (word32*)data;
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user