aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-10-15 11:28:41 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-10-15 11:28:41 +0100
commit6ceac089b6a8fee5aef14307b0561e98202947c5 (patch)
treebf105ef7acee480dc41c498fa8b7f0ba77a7effb /src/libcryptobox
parent61f993a096adee992be9b5333f6c0090440f00ed (diff)
downloadrspamd-6ceac089b6a8fee5aef14307b0561e98202947c5.tar.gz
rspamd-6ceac089b6a8fee5aef14307b0561e98202947c5.zip
Fix some portability issues.
Diffstat (limited to 'src/libcryptobox')
-rw-r--r--src/libcryptobox/cryptobox.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/libcryptobox/cryptobox.c b/src/libcryptobox/cryptobox.c
index 3169c01a0..0923905d7 100644
--- a/src/libcryptobox/cryptobox.c
+++ b/src/libcryptobox/cryptobox.c
@@ -27,6 +27,7 @@
#include <string.h>
#endif
+#include "config.h"
#include "cryptobox.h"
#include "platform_config.h"
#include "chacha20/chacha.h"
@@ -39,15 +40,6 @@
#include <cpuid.h>
#endif
-
-#ifndef ALIGNED
-#if defined(_MSC_VER)
-# define ALIGNED(x) __declspec(align(x))
-#else
-# define ALIGNED(x) __attribute__((aligned(x)))
-#endif
-#endif
-
unsigned long cpu_config = 0;
static const guchar n0[16] = {0};
@@ -174,7 +166,7 @@ void rspamd_cryptobox_encrypt_nm_inplace (guchar *data, gsize len,
const rspamd_nm_t nm, rspamd_sig_t sig)
{
poly1305_state mac_ctx;
- guchar ALIGNED(32) subkey[CHACHA_BLOCKBYTES];
+ guchar RSPAMD_ALIGNED(32) subkey[CHACHA_BLOCKBYTES];
chacha_state s;
gsize r;
@@ -215,7 +207,7 @@ void rspamd_cryptobox_encryptv_nm_inplace (struct rspamd_cryptobox_segment *segm
const rspamd_nm_t nm, rspamd_sig_t sig)
{
struct rspamd_cryptobox_segment *cur = segments, *start_seg = segments;
- guchar ALIGNED(32) subkey[CHACHA_BLOCKBYTES],
+ guchar RSPAMD_ALIGNED(32) subkey[CHACHA_BLOCKBYTES],
outbuf[CHACHA_BLOCKBYTES * 16];
poly1305_state mac_ctx;
guchar *out, *in;
@@ -308,7 +300,7 @@ 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 ALIGNED(32) subkey[CHACHA_BLOCKBYTES];
+ guchar RSPAMD_ALIGNED(32) subkey[CHACHA_BLOCKBYTES];
rspamd_sig_t mac;
chacha_state s;
gsize r;