VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Crypto
diff options
context:
space:
mode:
Diffstat (limited to 'src/Crypto')
-rw-r--r--src/Crypto/Streebog.c6
-rw-r--r--src/Crypto/config.h6
2 files changed, 10 insertions, 2 deletions
diff --git a/src/Crypto/Streebog.c b/src/Crypto/Streebog.c
index a5fbdbf6..60adea52 100644
--- a/src/Crypto/Streebog.c
+++ b/src/Crypto/Streebog.c
@@ -2229,6 +2229,7 @@ static void
g(unsigned long long *h, const unsigned long long *N, const unsigned char *m)
{
#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE
+#if CRYPTOPP_BOOL_SSE41_INTRINSICS_AVAILABLE
if (HasSSE41()) {
__m128i xmm0, xmm2, xmm4, xmm6; /* XMMR0-quadruple */
__m128i xmm1, xmm3, xmm5, xmm7; /* XMMR1-quadruple */
@@ -2255,8 +2256,9 @@ g(unsigned long long *h, const unsigned long long *N, const unsigned char *m)
#if CRYPTOPP_BOOL_X86
_mm_empty();
#endif
- }
- else if (HasSSE2()) {
+ } else
+#endif
+ if (HasSSE2()) {
__m128i xmm0, xmm2, xmm4, xmm6; /* XMMR0-quadruple */
__m128i xmm1, xmm3, xmm5, xmm7; /* XMMR1-quadruple */
unsigned int i;
diff --git a/src/Crypto/config.h b/src/Crypto/config.h
index d3638121..792ac678 100644
--- a/src/Crypto/config.h
+++ b/src/Crypto/config.h
@@ -123,6 +123,12 @@
#define CRYPTOPP_BOOL_ALIGN16 0
#endif
+#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE && (defined(__SSE4_1__) || defined(__INTEL_COMPILER) || defined(_MSC_VER))
+ #define CRYPTOPP_BOOL_SSE41_INTRINSICS_AVAILABLE 1
+#else
+ #define CRYPTOPP_BOOL_SSE41_INTRINSICS_AVAILABLE 0
+#endif
+
// how to allocate 16-byte aligned memory (for SSE2)
#if defined(_MSC_VER)
#define CRYPTOPP_MM_MALLOC_AVAILABLE