1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-20 02:25:14 -07:00

has_armcrypto_aes -> has_armcrypto

This commit is contained in:
Frank Denis 2019-10-23 19:07:33 +02:00
parent c9d80901bf
commit c8b6906c60
5 changed files with 13 additions and 13 deletions

View File

@ -606,7 +606,7 @@ _sodium_runtime_has_avx 0 0
_sodium_runtime_has_avx2 0 0 _sodium_runtime_has_avx2 0 0
_sodium_runtime_has_avx512f 0 0 _sodium_runtime_has_avx512f 0 0
_sodium_runtime_has_neon 0 0 _sodium_runtime_has_neon 0 0
_sodium_runtime_has_armcrypto_aes 0 0 _sodium_runtime_has_armcrypto 0 0
_sodium_runtime_has_pclmul 0 0 _sodium_runtime_has_pclmul 0 0
_sodium_runtime_has_rdrand 0 0 _sodium_runtime_has_rdrand 0 0
_sodium_runtime_has_sse2 0 0 _sodium_runtime_has_sse2 0 0

View File

@ -12,7 +12,7 @@ SODIUM_EXPORT_WEAK
int sodium_runtime_has_neon(void); int sodium_runtime_has_neon(void);
SODIUM_EXPORT_WEAK SODIUM_EXPORT_WEAK
int sodium_runtime_has_armcrypto_aes(void); int sodium_runtime_has_armcrypto(void);
SODIUM_EXPORT_WEAK SODIUM_EXPORT_WEAK
int sodium_runtime_has_sse2(void); int sodium_runtime_has_sse2(void);

View File

@ -18,7 +18,7 @@
typedef struct CPUFeatures_ { typedef struct CPUFeatures_ {
int initialized; int initialized;
int has_neon; int has_neon;
int has_armcrypto_aes; int has_armcrypto;
int has_sse2; int has_sse2;
int has_sse3; int has_sse3;
int has_ssse3; int has_ssse3;
@ -58,7 +58,7 @@ static int
_sodium_runtime_arm_cpu_features(CPUFeatures * const cpu_features) _sodium_runtime_arm_cpu_features(CPUFeatures * const cpu_features)
{ {
cpu_features->has_neon = 0; cpu_features->has_neon = 0;
cpu_features->has_armcrypto_aes = 0; cpu_features->has_armcrypto = 0;
#ifndef __ARM_ARCH #ifndef __ARM_ARCH
return -1; /* LCOV_EXCL_LINE */ return -1; /* LCOV_EXCL_LINE */
@ -80,7 +80,7 @@ _sodium_runtime_arm_cpu_features(CPUFeatures * const cpu_features)
} }
#if __ARM_FEATURE_CRYPTO #if __ARM_FEATURE_CRYPTO
cpu_features->has_armcrypto_aes = 1; cpu_features->has_armcrypto = 1;
#elif defined(__APPLE__) && defined(CPU_TYPE_ARM64) && defined(CPU_SUBTYPE_ARM64E) #elif defined(__APPLE__) && defined(CPU_TYPE_ARM64) && defined(CPU_SUBTYPE_ARM64E)
{ {
cpu_type_t cpu_type; cpu_type_t cpu_type;
@ -94,16 +94,16 @@ _sodium_runtime_arm_cpu_features(CPUFeatures * const cpu_features)
NULL, 0) == 0 && NULL, 0) == 0 &&
(cpu_subtype == CPU_SUBTYPE_ARM64E || (cpu_subtype == CPU_SUBTYPE_ARM64E ||
cpu_subtype == CPU_SUBTYPE_ARM64_V8)) { cpu_subtype == CPU_SUBTYPE_ARM64_V8)) {
cpu_features->has_armcrypto_aes = 1; cpu_features->has_armcrypto = 1;
} }
} }
#elif defined(HAVE_ANDROID_GETCPUFEATURES) && defined(ANDROID_CPU_ARM_FEATURE_AES) #elif defined(HAVE_ANDROID_GETCPUFEATURES) && defined(ANDROID_CPU_ARM_FEATURE_AES)
cpu_features->has_armcrypto_aes = cpu_features->has_armcrypto =
(android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_AES) != 0x0; (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_AES) != 0x0;
#elif defined(HAVE_GETAUXVAL) && defined(AT_HWCAP) && defined(__aarch64__) #elif defined(HAVE_GETAUXVAL) && defined(AT_HWCAP) && defined(__aarch64__)
cpu_features->has_armcrypto_aes = (getauxval(AT_HWCAP) & (1L << 3)) != 0; cpu_features->has_armcrypto = (getauxval(AT_HWCAP) & (1L << 3)) != 0;
#elif defined(HAVE_GETAUXVAL) && defined(AT_HWCAP2) && defined(__arm__) #elif defined(HAVE_GETAUXVAL) && defined(AT_HWCAP2) && defined(__arm__)
cpu_features->has_armcrypto_aes = (getauxval(AT_HWCAP2) & (1L << 0)) != 0; cpu_features->has_armcrypto = (getauxval(AT_HWCAP2) & (1L << 0)) != 0;
#endif #endif
return 0; return 0;
@ -289,9 +289,9 @@ sodium_runtime_has_neon(void)
} }
int int
sodium_runtime_has_armcrypto_aes(void) sodium_runtime_has_armcrypto(void)
{ {
return _cpu_features.has_armcrypto_aes; return _cpu_features.has_armcrypto;
} }
int int

View File

@ -19,7 +19,7 @@ main(void)
assert(sodium_init() == 1); assert(sodium_init() == 1);
(void) sodium_runtime_has_neon(); (void) sodium_runtime_has_neon();
(void) sodium_runtime_has_armcrypto_aes(); (void) sodium_runtime_has_armcrypto();
(void) sodium_runtime_has_sse2(); (void) sodium_runtime_has_sse2();
(void) sodium_runtime_has_sse3(); (void) sodium_runtime_has_sse3();
(void) sodium_runtime_has_ssse3(); (void) sodium_runtime_has_ssse3();

View File

@ -680,7 +680,7 @@ sodium_munlock
sodium_munshield sodium_munshield
sodium_pad sodium_pad
sodium_runtime_has_aesni sodium_runtime_has_aesni
sodium_runtime_has_armcrypto_aes sodium_runtime_has_armcrypto
sodium_runtime_has_avx sodium_runtime_has_avx
sodium_runtime_has_avx2 sodium_runtime_has_avx2
sodium_runtime_has_avx512f sodium_runtime_has_avx512f