From 5a566c041cf5cf8f87578bde44bc76b91790cdfe Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Tue, 12 Nov 2013 09:41:23 -0800 Subject: [PATCH] We can't enforce 64-bit alignment of aes256 context w/ the current interface --- src/libsodium/crypto_stream/aes256estream/hongjun/aes256-ctr.c | 1 + src/libsodium/crypto_stream/aes256estream/hongjun/ecrypt-sync.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libsodium/crypto_stream/aes256estream/hongjun/aes256-ctr.c b/src/libsodium/crypto_stream/aes256estream/hongjun/aes256-ctr.c index 4983a172..1eca36f7 100644 --- a/src/libsodium/crypto_stream/aes256estream/hongjun/aes256-ctr.c +++ b/src/libsodium/crypto_stream/aes256estream/hongjun/aes256-ctr.c @@ -219,6 +219,7 @@ crypto_stream(unsigned char *out, unsigned long long outlen, const unsigned char *n, const unsigned char *k) { unsigned char d[crypto_stream_BEFORENMBYTES]; + crypto_stream_beforenm(d, k); crypto_stream_afternm(out, outlen, n, d); diff --git a/src/libsodium/crypto_stream/aes256estream/hongjun/ecrypt-sync.h b/src/libsodium/crypto_stream/aes256estream/hongjun/ecrypt-sync.h index 6dafedbe..23f2aeef 100644 --- a/src/libsodium/crypto_stream/aes256estream/hongjun/ecrypt-sync.h +++ b/src/libsodium/crypto_stream/aes256estream/hongjun/ecrypt-sync.h @@ -12,7 +12,7 @@ typedef uint32_t u32; #define Nb 4 #pragma pack(push, 1) -__attribute__((aligned(64))) typedef struct ECRYPT_ctx +typedef struct ECRYPT_ctx { u32 round_key[Nr+1][4]; u32 counter[4];