]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/corecrypto/ccsha2/src/ccsha256_di.c
xnu-6153.11.26.tar.gz
[apple/xnu.git] / osfmk / corecrypto / ccsha2 / src / ccsha256_di.c
index d31a9402c878c55e6a37d8d78a9077ee966cc535..2a61b8413b9bc3613877f5a36fc3f18d23c1bd4b 100644 (file)
@@ -47,16 +47,20 @@ ccsha256_di(void)
 #if defined (__x86_64__)
        if (CC_HAS_AVX512_AND_IN_KERNEL()) {
                return &ccsha256_vng_intel_SupplementalSSE3_di;
-       } else {
-               return CC_HAS_AVX2() ? &ccsha256_vng_intel_AVX2_di :
-                      ((CC_HAS_AVX1() ? &ccsha256_vng_intel_AVX1_di :
-                      &ccsha256_vng_intel_SupplementalSSE3_di));
+       } else
+#if CC_ACCELERATECRYPTO
+       { return &ccsha256_vng_intel_di; // use AccelerateCrypto
        }
+#else
+       { return CC_HAS_AVX2() ? &ccsha256_vng_intel_AVX2_di :
+                ((CC_HAS_AVX1() ? &ccsha256_vng_intel_AVX1_di :
+                &ccsha256_vng_intel_SupplementalSSE3_di)); }
+#endif
 #else
        return &ccsha256_vng_intel_SupplementalSSE3_di;
 #endif
-#elif  CCSHA2_VNG_ARMV7NEON
-       return &ccsha256_vng_armv7neon_di;
+#elif  CCSHA2_VNG_ARM
+       return &ccsha256_vng_arm_di;
 #elif CCSHA256_ARMV6M_ASM
        return &ccsha256_v6m_di;
 #else