From 74ccac9e832d128a07340280e19b33efc88c1650 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 3 Jan 2019 18:34:24 +0100 Subject: [PATCH] Do not assume that CRYPTO_ALIGN works --- .../blake2b/ref/blake2b-compress-avx2.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.h b/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.h index e3219777..d08603a8 100644 --- a/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.h +++ b/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.h @@ -5,12 +5,17 @@ #define LOADU128(p) _mm_loadu_si128((const __m128i *) (p)) #define STOREU128(p, r) _mm_storeu_si128((__m128i *) (p), r) -#define LOAD(p) _mm256_load_si256((const __m256i *) (p)) -#define STORE(p, r) _mm256_store_si256((__m256i *) (p), r) - #define LOADU(p) _mm256_loadu_si256((const __m256i *) (p)) #define STOREU(p, r) _mm256_storeu_si256((__m256i *) (p), r) +#if defined(__INTEL_COMPILER) || defined(_MSC_VER) || defined(__GNUC__) +# define LOAD(p) _mm256_load_si256((const __m256i *) (p)) +# define STORE(p, r) _mm256_store_si256((__m256i *) (p), r) +#else +# define LOAD(p) LOADU(p) +# define STORE(p, r) STOREU(p, r) +#endif + static inline uint64_t LOADU64(const void *p) {