VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Crypto
diff options
context:
space:
mode:
Diffstat (limited to 'src/Crypto')
-rw-r--r--src/Crypto/cpu.c2
-rw-r--r--src/Crypto/cpu.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/Crypto/cpu.c b/src/Crypto/cpu.c
index 99b81700..27d62e43 100644
--- a/src/Crypto/cpu.c
+++ b/src/Crypto/cpu.c
@@ -330,7 +330,9 @@ void DetectX86Features()
g_hasSSE42 = g_hasSSE2 && (cpuid1[2] & (1 << 20));
g_hasSSE41 = g_hasSSE2 && (cpuid1[2] & (1 << 19));
g_hasSSSE3 = g_hasSSE2 && (cpuid1[2] & (1<<9));
+#ifndef CRYPTOPP_DISABLE_AESNI
g_hasAESNI = g_hasSSE2 && (cpuid1[2] & (1<<25));
+#endif
g_hasCLMUL = g_hasSSE2 && (cpuid1[2] & (1<<1));
#if !defined (_UEFI) && ((defined(__AES__) && defined(__PCLMUL__)) || defined(__INTEL_COMPILER) || CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE)
diff --git a/src/Crypto/cpu.h b/src/Crypto/cpu.h
index 58729f32..1a3efcee 100644
--- a/src/Crypto/cpu.h
+++ b/src/Crypto/cpu.h
@@ -209,7 +209,9 @@ extern "C" {
#endif
#define CRYPTOPP_CPUID_AVAILABLE
+#ifndef CRYPTOPP_DISABLE_AESNI
#define TC_AES_HW_CPU
+#endif
// these should not be used directly
extern volatile int g_x86DetectionDone;