Merge pull request #8511 from SparkiDev/intel_sha_not_avx1

SHA256: Intel flags has SHA but not AVX1 or AVX2
This commit is contained in:
David Garske
2025-03-03 13:59:10 -08:00
committed by GitHub

View File

@@ -209,7 +209,8 @@ on the specific device platform.
#define SHA256_UPDATE_REV_BYTES(ctx) (sha256->sha_method == SHA256_C) #define SHA256_UPDATE_REV_BYTES(ctx) (sha256->sha_method == SHA256_C)
#else #else
#define SHA256_UPDATE_REV_BYTES(ctx) \ #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 #endif
#elif defined(FREESCALE_MMCAU_SHA) #elif defined(FREESCALE_MMCAU_SHA)
#define SHA256_UPDATE_REV_BYTES(ctx) 0 /* reverse not needed on update */ #define SHA256_UPDATE_REV_BYTES(ctx) 0 /* reverse not needed on update */
@@ -1652,7 +1653,8 @@ static int InitSha256(wc_Sha256* sha256)
#ifdef WC_C_DYNAMIC_FALLBACK #ifdef WC_C_DYNAMIC_FALLBACK
if (sha256->sha_method != SHA256_C) if (sha256->sha_method != SHA256_C)
#else #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
#endif #endif
{ {