diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2025-01-26 16:21:13 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2025-01-26 16:21:13 +0100 |
commit | 247c98d9548fead121e5314727782a4694bc0de3 (patch) | |
tree | aa6dd3e77188705a9405ec406bb9bd4267c52476 /src/Crypto/config.h | |
parent | 5ff256a53d30031d9500e38c699084efc6c3bd56 (diff) | |
download | VeraCrypt-247c98d9548fead121e5314727782a4694bc0de3.tar.gz VeraCrypt-247c98d9548fead121e5314727782a4694bc0de3.zip |
Implement SHA256 acceleration on ARM64 platforms using CPU instructions
Diffstat (limited to 'src/Crypto/config.h')
-rw-r--r-- | src/Crypto/config.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Crypto/config.h b/src/Crypto/config.h index dd8e3f06..f485c07e 100644 --- a/src/Crypto/config.h +++ b/src/Crypto/config.h @@ -240,6 +240,19 @@ # endif // Platforms #endif +// ARMv8 and SHA-1, SHA-256. -march=armv8-a+crypto or above must be present +// Requires GCC 4.8, Clang 3.3 or Visual Studio 2017 +#if !defined(CRYPTOPP_ARM_SHA_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ARM_SHA) +# if defined(__aarch32__) || defined(__aarch64__) || defined(_M_ARM64) +# if defined(__ARM_FEATURE_CRYPTO) || (CRYPTOPP_GCC_VERSION >= 40800) || \ + (CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40300) || \ + (CRYPTOPP_MSC_VERSION >= 1916) +# define CRYPTOPP_ARM_SHA1_AVAILABLE 1 +# define CRYPTOPP_ARM_SHA2_AVAILABLE 1 +# endif // Compilers +# endif // Platforms +#endif + // Undo the ASM and Intrinsic related defines due to X32. #if CRYPTOPP_BOOL_X32 # undef CRYPTOPP_BOOL_X64 |