diff options
author | Mattias Andrée <maandree@kth.se> | 2022-02-17 19:43:51 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2022-02-17 19:43:51 +0100 |
commit | e1ff5cc788f1f418e75d63b8e4c4fe5554fbe2c8 (patch) | |
tree | 1639a0ba6c51ab27166b0171f75dad6c5300fe4b /libar2_hash.c | |
parent | bump version (diff) | |
download | libar2-e1ff5cc788f1f418e75d63b8e4c4fe5554fbe2c8.tar.gz libar2-e1ff5cc788f1f418e75d63b8e4c4fe5554fbe2c8.tar.bz2 libar2-e1ff5cc788f1f418e75d63b8e4c4fe5554fbe2c8.tar.xz |
Some fixes1.2
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | libar2_hash.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libar2_hash.c b/libar2_hash.c index 4ccbf18..5704ac4 100644 --- a/libar2_hash.c +++ b/libar2_hash.c @@ -725,7 +725,7 @@ libar2_hash(void *hash, void *msg, size_t msglen, struct libar2_argon2_parameter #ifndef USING_LITTLE_ENDIAN unsigned char block[1024 + 128]; #endif - unsigned char hash0[256]; + _Alignas(4) unsigned char hash0[256]; uint_least32_t blocks, seglen, lanelen; struct block *memory; size_t i, p, s, nthreads, ts[16], ti, tn, bufsize; @@ -760,7 +760,8 @@ libar2_hash(void *hash, void *msg, size_t msglen, struct libar2_argon2_parameter return -1; if (params->type == LIBAR2_ARGON2DS) { - sbox = ctx->allocate(1024, sizeof(*sbox), ALIGNOF(uint_least64_t), ctx); + alignment = MAX(ALIGNOF(uint_least64_t), MAX_SIMD_ALIGNMENT); + sbox = ctx->allocate(1024, sizeof(*sbox), alignment, ctx); if (!sbox) { ctx->deallocate(memory, ctx); return -1; |