VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Crypto/config.h
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2024-11-10 21:08:00 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2024-11-10 21:08:00 +0100
commit04c747fb2df007eddc27e515acaa91f8993a70af (patch)
treef1ecf9078e500f022d78f2441834bcaf3985ccd1 /src/Crypto/config.h
parentfcc0c8283679c696a9938791bf6f7a3ea2921716 (diff)
downloadVeraCrypt-04c747fb2df007eddc27e515acaa91f8993a70af.tar.gz
VeraCrypt-04c747fb2df007eddc27e515acaa91f8993a70af.zip
Add support for SHA-256 x86 instrinsic for enhance performance of PBKDF2-HMAC-SHA256
Diffstat (limited to 'src/Crypto/config.h')
-rw-r--r--src/Crypto/config.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Crypto/config.h b/src/Crypto/config.h
index d2a9cfea..774f7951 100644
--- a/src/Crypto/config.h
+++ b/src/Crypto/config.h
@@ -152,6 +152,15 @@
#define CRYPTOPP_BOOL_SSE41_INTRINSICS_AVAILABLE 0
#endif
+#if !defined(CRYPTOPP_DISABLE_SHANI) && !defined(_M_ARM) && !defined(_M_ARM64) && !defined(__arm__) && !defined(__aarch64__) && !defined(__arm64__) && defined(CRYPTOPP_BOOL_SSE41_INTRINSICS_AVAILABLE) && \
+ (defined(__SHA__) || (_MSC_VER >= 1900) || (__SUNPRO_CC >= 0x5160) || \
+ (CRYPTOPP_GCC_VERSION >= 40900) || (__INTEL_COMPILER >= 1600) || \
+ (CRYPTOPP_LLVM_CLANG_VERSION >= 30400) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50100))
+ #define CRYPTOPP_SHANI_AVAILABLE 1
+#else
+ #define CRYPTOPP_SHANI_AVAILABLE 0
+#endif
+
// how to allocate 16-byte aligned memory (for SSE2)
#if defined(_MSC_VER)
#define CRYPTOPP_MM_MALLOC_AVAILABLE