]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Relax alignment requirements
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 18 May 2018 22:47:37 +0000 (23:47 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 18 May 2018 22:47:37 +0000 (23:47 +0100)
Issue: #2222

contrib/t1ha/t1ha.h
src/libcryptobox/cryptobox.h

index 191758c57ee2859e5b839697ed0710047fa818be..3d267838ce0710cf5381d24186c2ab07ceccacdd 100644 (file)
 #endif /* T1HA_API */
 
 #if defined(_MSC_VER)
-#define T1HA_ALIGN_PREFIX __declspec(align(32)) /* required only for SIMD */
+#define T1HA_ALIGN_PREFIX __declspec(align(16)) /* required only for SIMD */
 #else
 #define T1HA_ALIGN_PREFIX
 #endif /* _MSC_VER */
 
 #if defined(__GNUC__)
 #define T1HA_ALIGN_SUFFIX                                                      \
-  __attribute__((aligned(32))) /* required only for SIMD */
+  __attribute__((aligned(16))) /* required only for SIMD */
 #else
 #define T1HA_ALIGN_SUFFIX
 #endif /* GCC x86 */
index 9fc5c7fe964f4699ffe155fbb81bf9c572e033fe..1045547a25ca83fe53a07e37c5f10d1bdbc9724f 100644 (file)
@@ -312,7 +312,7 @@ guint rspamd_cryptobox_mac_bytes (enum rspamd_cryptobox_mode mode);
 guint rspamd_cryptobox_signature_bytes (enum rspamd_cryptobox_mode mode);
 
 /* Hash IUF interface */
-typedef struct RSPAMD_ALIGNED(32) rspamd_cryptobox_hash_state_s  {
+typedef struct RSPAMD_ALIGNED(16) rspamd_cryptobox_hash_state_s  {
        unsigned char opaque[256];
 } rspamd_cryptobox_hash_state_t;
 
@@ -343,7 +343,7 @@ void rspamd_cryptobox_hash (guchar *out,
                gsize keylen);
 
 /* Non crypto hash IUF interface */
-typedef struct RSPAMD_ALIGNED(32) rspamd_cryptobox_fast_hash_state_s  {
+typedef struct RSPAMD_ALIGNED(16) rspamd_cryptobox_fast_hash_state_s  {
        unsigned char opaque[64 + sizeof (size_t) + sizeof (uint64_t)];
 } rspamd_cryptobox_fast_hash_state_t;