diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2025-01-18 16:37:26 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2025-01-18 16:37:26 +0100 |
commit | cca323964ee66789638f7d41b7bfce69a596f553 (patch) | |
tree | b879160aaaff329bc4448b7f9a88dee7925481d2 /src | |
parent | ff63e5aad0ada475b5751db19d6f553193c04673 (diff) | |
download | VeraCrypt-cca323964ee66789638f7d41b7bfce69a596f553.tar.gz VeraCrypt-cca323964ee66789638f7d41b7bfce69a596f553.zip |
Linux: Add missing header in ARM64 build. Add .oarmv8crypto to .gitignore
Diffstat (limited to 'src')
-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 @@ -453,46 +453,48 @@ void DisableCPUExtendedFeatures () g_hasSSE2 = 0; g_hasISSE = 0; g_hasMMX = 0; g_hasSSE2 = 0; g_hasISSE = 0; g_hasMMX = 0; g_hasAVX = 0; g_hasAVX2 = 0; g_hasBMI2 = 0; g_hasSSE42 = 0; g_hasSSE41 = 0; g_hasSSSE3 = 0; 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__) // Apple Sillcon (M1) and later return 1; #elif defined(_WIN32) && defined(_M_ARM64) #ifdef TC_WINDOWS_DRIVER if (ExIsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE) != 0) return 1; #else if (IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE) != 0) return 1; #endif #endif return 0; |