From 7305c533516df296124d6b2415482d2febb7328a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 16 Sep 2012 05:22:38 +0200 Subject: Fix alignment for NaCl's core2 assembler implementation of AES128-CTR --- src/fastd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/fastd.c') diff --git a/src/fastd.c b/src/fastd.c index f1df118..f9d8403 100644 --- a/src/fastd.c +++ b/src/fastd.c @@ -269,7 +269,7 @@ static size_t methods_min_encrypt_head_space(fastd_context *ctx) { ret = s; } - return alignto(ret, 8); + return alignto(ret, 16); } static size_t methods_min_decrypt_head_space(fastd_context *ctx) { @@ -285,7 +285,8 @@ static size_t methods_min_decrypt_head_space(fastd_context *ctx) { ret = s; } - return alignto(ret, 8); + /* ugly hack to get alignment right for aes128-gcm, which needs data aligned to 16 and has a 24 byte header */ + return alignto(ret, 16) + 8; } static size_t methods_min_encrypt_tail_space(fastd_context *ctx) { -- cgit v1.2.3