From e88f889695fa34ab65999175f868be3483a339fa Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 16 Feb 2022 13:57:04 +0100 Subject: Fix style + minimal optimisation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libar2_hash.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libar2_hash.c b/libar2_hash.c index 98c50cb..f1e6d9b 100644 --- a/libar2_hash.c +++ b/libar2_hash.c @@ -279,12 +279,11 @@ fill_segment(struct block *memory, const uint_least64_t *sbox, struct libar2_arg inputb.w[3] = blocks; inputb.w[4] = params->t_cost; inputb.w[5] = (uint_least32_t)params->type; - } - - if (!pass && !slice) { - if (data_independent) { + if (!pass && !slice) { next_address_block(&addrb, &inputb); + index = 2; } + } else if (!pass && !slice) { index = 2; } @@ -296,9 +295,8 @@ fill_segment(struct block *memory, const uint_least64_t *sbox, struct libar2_arg prevoff = off - 1; if (data_independent) { i = index % ELEMSOF(addrb.w); - if (!i) { + if (!i) next_address_block(&addrb, &inputb); - } prand = addrb.w[i]; } else { prand = memory[prevoff].w[0]; -- cgit v1.2.3-70-g09d2