aboutsummaryrefslogtreecommitdiffstats
path: root/libar2_hash.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-02-17 19:43:51 +0100
committerMattias Andrée <maandree@kth.se>2022-02-17 19:43:51 +0100
commite1ff5cc788f1f418e75d63b8e4c4fe5554fbe2c8 (patch)
tree1639a0ba6c51ab27166b0171f75dad6c5300fe4b /libar2_hash.c
parentbump version (diff)
downloadlibar2-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.c5
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;