1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-24 20:45:17 -07:00

On Apple devices, the ARM64_V8 subtype always has the crypto extensions

This commit is contained in:
Frank Denis 2019-10-23 17:55:27 +02:00
parent dd5fbb632b
commit a8dc93192d

View File

@ -91,7 +91,9 @@ _sodium_runtime_arm_cpu_features(CPUFeatures * const cpu_features)
if (sysctlbyname("hw.cputype", &cpu_type, &cpu_type_len, if (sysctlbyname("hw.cputype", &cpu_type, &cpu_type_len,
NULL, 0) == 0 && cpu_type == CPU_TYPE_ARM64 && NULL, 0) == 0 && cpu_type == CPU_TYPE_ARM64 &&
sysctlbyname("hw.cpusubtype", &cpu_subtype, &cpu_subtype_len, sysctlbyname("hw.cpusubtype", &cpu_subtype, &cpu_subtype_len,
NULL, 0) == 0 && cpu_type == CPU_SUBTYPE_ARM64E) { NULL, 0) == 0 &&
(cpu_subtype == CPU_SUBTYPE_ARM64E ||
cpu_subtype == CPU_SUBTYPE_ARM64_V8)) {
cpu_features->has_armcrypto_aes = 1; cpu_features->has_armcrypto_aes = 1;
} }
} }