Skip to content

Commit

Permalink
Merge pull request #8511 from SparkiDev/intel_sha_not_avx1
Browse files Browse the repository at this point in the history
SHA256: Intel flags has SHA but not AVX1 or AVX2
  • Loading branch information
dgarske authored Mar 3, 2025
2 parents 72d08a1 + b104887 commit 2b099da
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wolfcrypt/src/sha256.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ on the specific device platform.
#define SHA256_UPDATE_REV_BYTES(ctx) (sha256->sha_method == SHA256_C)
#else
#define SHA256_UPDATE_REV_BYTES(ctx) \
(!IS_INTEL_AVX1(intel_flags) && !IS_INTEL_AVX2(intel_flags))
(!IS_INTEL_AVX1(intel_flags) && !IS_INTEL_AVX2(intel_flags) && \
!IS_INTEL_SHA(intel_flags))
#endif
#elif defined(FREESCALE_MMCAU_SHA)
#define SHA256_UPDATE_REV_BYTES(ctx) 0 /* reverse not needed on update */
Expand Down Expand Up @@ -1652,7 +1653,8 @@ static int InitSha256(wc_Sha256* sha256)
#ifdef WC_C_DYNAMIC_FALLBACK
if (sha256->sha_method != SHA256_C)
#else
if (IS_INTEL_AVX1(intel_flags) || IS_INTEL_AVX2(intel_flags))
if (IS_INTEL_AVX1(intel_flags) || IS_INTEL_AVX2(intel_flags) ||
IS_INTEL_SHA(intel_flags))
#endif
#endif
{
Expand Down

0 comments on commit 2b099da

Please sign in to comment.