From c8b6906c60570002d92c024cb2f52a567d2a633f Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 23 Oct 2019 19:07:33 +0200 Subject: [PATCH] has_armcrypto_aes -> has_armcrypto --- dist-build/emscripten-symbols.def | 2 +- src/libsodium/include/sodium/runtime.h | 2 +- src/libsodium/sodium/runtime.c | 18 +++++++++--------- test/default/sodium_core.c | 2 +- test/symbols/all-symbols.txt | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dist-build/emscripten-symbols.def b/dist-build/emscripten-symbols.def index 8e3abf0b..8b5a3cbd 100644 --- a/dist-build/emscripten-symbols.def +++ b/dist-build/emscripten-symbols.def @@ -606,7 +606,7 @@ _sodium_runtime_has_avx 0 0 _sodium_runtime_has_avx2 0 0 _sodium_runtime_has_avx512f 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_rdrand 0 0 _sodium_runtime_has_sse2 0 0 diff --git a/src/libsodium/include/sodium/runtime.h b/src/libsodium/include/sodium/runtime.h index 929fb5ff..c1cec853 100644 --- a/src/libsodium/include/sodium/runtime.h +++ b/src/libsodium/include/sodium/runtime.h @@ -12,7 +12,7 @@ SODIUM_EXPORT_WEAK int sodium_runtime_has_neon(void); SODIUM_EXPORT_WEAK -int sodium_runtime_has_armcrypto_aes(void); +int sodium_runtime_has_armcrypto(void); SODIUM_EXPORT_WEAK int sodium_runtime_has_sse2(void); diff --git a/src/libsodium/sodium/runtime.c b/src/libsodium/sodium/runtime.c index c8a5bad2..ca5d918a 100644 --- a/src/libsodium/sodium/runtime.c +++ b/src/libsodium/sodium/runtime.c @@ -18,7 +18,7 @@ typedef struct CPUFeatures_ { int initialized; int has_neon; - int has_armcrypto_aes; + int has_armcrypto; int has_sse2; int has_sse3; int has_ssse3; @@ -58,7 +58,7 @@ static int _sodium_runtime_arm_cpu_features(CPUFeatures * const cpu_features) { cpu_features->has_neon = 0; - cpu_features->has_armcrypto_aes = 0; + cpu_features->has_armcrypto = 0; #ifndef __ARM_ARCH return -1; /* LCOV_EXCL_LINE */ @@ -80,7 +80,7 @@ _sodium_runtime_arm_cpu_features(CPUFeatures * const cpu_features) } #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) { cpu_type_t cpu_type; @@ -94,16 +94,16 @@ _sodium_runtime_arm_cpu_features(CPUFeatures * const cpu_features) NULL, 0) == 0 && (cpu_subtype == CPU_SUBTYPE_ARM64E || 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) - cpu_features->has_armcrypto_aes = + cpu_features->has_armcrypto = (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_AES) != 0x0; #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__) - cpu_features->has_armcrypto_aes = (getauxval(AT_HWCAP2) & (1L << 0)) != 0; + cpu_features->has_armcrypto = (getauxval(AT_HWCAP2) & (1L << 0)) != 0; #endif return 0; @@ -289,9 +289,9 @@ sodium_runtime_has_neon(void) } int -sodium_runtime_has_armcrypto_aes(void) +sodium_runtime_has_armcrypto(void) { - return _cpu_features.has_armcrypto_aes; + return _cpu_features.has_armcrypto; } int diff --git a/test/default/sodium_core.c b/test/default/sodium_core.c index 7f930bb8..82fd57aa 100644 --- a/test/default/sodium_core.c +++ b/test/default/sodium_core.c @@ -19,7 +19,7 @@ main(void) assert(sodium_init() == 1); (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_sse3(); (void) sodium_runtime_has_ssse3(); diff --git a/test/symbols/all-symbols.txt b/test/symbols/all-symbols.txt index 67b04686..1d11395a 100644 --- a/test/symbols/all-symbols.txt +++ b/test/symbols/all-symbols.txt @@ -680,7 +680,7 @@ sodium_munlock sodium_munshield sodium_pad sodium_runtime_has_aesni -sodium_runtime_has_armcrypto_aes +sodium_runtime_has_armcrypto sodium_runtime_has_avx sodium_runtime_has_avx2 sodium_runtime_has_avx512f