#include <gmime/gmime.h>
#endif
+#ifndef ALIGN
+#if defined(_MSC_VER)
+# define ALIGN(x) __declspec(align(x))
+#else
+# define ALIGN(x) __attribute__((aligned(x)))
+#endif
+#endif
+
/* Forwarded declaration */
struct module_ctx;
struct rspamd_config;
#include <stddef.h>
#include <stdint.h>
+#ifndef ALIGN
#if defined(_MSC_VER)
-#define ALIGN(x) __declspec(align(x))
+# define ALIGN(x) __declspec(align(x))
#else
-#define ALIGN(x) __attribute__((aligned(x)))
+# define ALIGN(x) __attribute__((aligned(x)))
+#endif
#endif
#if defined(__cplusplus)
const rspamd_nm_t nm, rspamd_sig_t sig)
{
poly1305_state mac_ctx;
- guchar subkey[CHACHA_BLOCKBYTES];
- chacha_state s;
+ ALIGN(64) guchar subkey[CHACHA_BLOCKBYTES];
+ ALIGN(64) chacha_state s;
gsize r;
xchacha_init (&s, (const chacha_key *)nm, (const chacha_iv24 *)nonce, 20);
rspamd_cryptobox_decrypt_nm_inplace (guchar *data, gsize len,
const rspamd_nonce_t nonce, const rspamd_nm_t nm, const rspamd_sig_t sig)
{
- poly1305_state mac_ctx;
- guchar subkey[CHACHA_BLOCKBYTES];
+ ALIGN(64) poly1305_state mac_ctx;
+ ALIGN(64) guchar subkey[CHACHA_BLOCKBYTES];
rspamd_sig_t mac;
- chacha_state s;
+ ALIGN(64) chacha_state s;
gsize r;
gboolean ret = TRUE;
static const int file_blocks = 8;
static const int pconns = 100;
-static const int ntests = 100;
+static const int ntests = 300;
static void
rspamd_server_error (struct rspamd_http_connection_entry *conn_ent,