From 31ff91caabf56c6fa4ca9013c3d51cb7bf698046 Mon Sep 17 00:00:00 2001 From: Loup Vaillant Date: Thu, 22 Mar 2018 21:47:13 +0100 Subject: [PATCH] Corrected possible misalignment in the tests Argon2i must have its work area aligned for uint64_t. I don't recall any guarantee of alignment when allocating an array of uint8_t on the stack. So we allocate on the heap instead. --- tests/test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test.c b/tests/test.c index 7669e0d..aa92147 100644 --- a/tests/test.c +++ b/tests/test.c @@ -571,7 +571,7 @@ static int p_argon2i_overlap() { int status = 0; FOR (i, 0, 128) { - RANDOM_INPUT(work_area, 1024 * 8); + u8 *work_area = (u8*)alloc(1024 * 8); p_random(work_area, 1024 * 8); u32 pass_offset = rand64() % 128; u32 salt_offset = rand64() % 128; u32 key_offset = rand64() % 128; -- 2.47.3