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.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/fastd.h') diff --git a/src/fastd.h b/src/fastd.h index d7946ea..023576b 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -289,7 +289,8 @@ static inline size_t alignto(size_t l, size_t a) { static inline fastd_buffer fastd_buffer_alloc(size_t len, size_t head_space, size_t tail_space) { size_t base_len = head_space+len+tail_space; - uint8_t *ptr = malloc(base_len); + void *ptr; + posix_memalign(&ptr, 16, base_len); return (fastd_buffer){ .base = ptr, .base_len = base_len, .data = ptr+head_space, .len = len }; } -- cgit v1.2.3