From: Loup Vaillant Date: Thu, 22 Mar 2018 20:47:13 +0000 (+0100) Subject: Corrected possible misalignment in the tests X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=31ff91caabf56c6fa4ca9013c3d51cb7bf698046;p=Monocypher.git 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. --- 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;