Skip to content

Commit b1f2ff7

Browse files
committed
wolfcrypt/src/sha256.c: in wc_Sha256HashBlock(), use ByteReverseWords() rather than a series of ByteReverseWord32() to get WOLFSSL_USE_ALIGN.
1 parent be301f9 commit b1f2ff7

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

wolfcrypt/src/sha256.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,14 +1913,7 @@ static WC_INLINE int Transform_Sha256_Len(wc_Sha256* sha256, const byte* data,
19131913
hash32 = digest;
19141914
}
19151915
#endif
1916-
hash32[0] = ByteReverseWord32(digest[0]);
1917-
hash32[1] = ByteReverseWord32(digest[1]);
1918-
hash32[2] = ByteReverseWord32(digest[2]);
1919-
hash32[3] = ByteReverseWord32(digest[3]);
1920-
hash32[4] = ByteReverseWord32(digest[4]);
1921-
hash32[5] = ByteReverseWord32(digest[5]);
1922-
hash32[6] = ByteReverseWord32(digest[6]);
1923-
hash32[7] = ByteReverseWord32(digest[7]);
1916+
ByteReverseWords(hash32, digest, (word32)(sizeof(word32) * 8));
19241917
#if WOLFSSL_GENERAL_ALIGNMENT < 4
19251918
if (hash != (byte*)hash32) {
19261919
XMEMCPY(hash, hash32, WC_SHA256_DIGEST_SIZE);

0 commit comments

Comments
 (0)