diff options
Diffstat (limited to 'src/Crypto/cpu.c')
-rw-r--r-- | src/Crypto/cpu.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Crypto/cpu.c b/src/Crypto/cpu.c index 85278a92..0f1ba54d 100644 --- a/src/Crypto/cpu.c +++ b/src/Crypto/cpu.c @@ -465,22 +465,24 @@ void DisableCPUExtendedFeatures () g_hasAESNI = 0; g_hasCLMUL = 0; g_hasSHA256 = 0; } #endif #if CRYPTOPP_BOOL_ARMV8 - -volatile int g_hasAESARM = 0; - +#if defined(__linux__) && defined(__aarch64__) +#include <sys/auxv.h> #ifndef HWCAP_AES # define HWCAP_AES (1 << 3) #endif +#endif + +volatile int g_hasAESARM = 0; inline int CPU_QueryAES() { #if defined(CRYPTOPP_ARM_AES_AVAILABLE) #if defined(__linux__) && defined(__aarch64__) if ((getauxval(AT_HWCAP) & HWCAP_AES) != 0) return 1; #elif defined(__APPLE__) && defined(__aarch64__) |