From 4585961deef4469a8d4008e926881bc87b4e1a78 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 6 Nov 2014 22:10:37 +0100 Subject: fix bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libkeccak/digest.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/libkeccak/digest.c b/src/libkeccak/digest.c index 640f7b9..aa4e24a 100644 --- a/src/libkeccak/digest.c +++ b/src/libkeccak/digest.c @@ -101,12 +101,13 @@ void libkeccak_f_round(libkeccak_state_t* restrict state, int_fast64_t rc) int_fast64_t* restrict A = state->S; int_fast64_t B[25]; int_fast64_t C[5]; - int_fast64_t da, db, dc, dd, de, wmod = state->wmod; + int_fast64_t da, db, dc, dd, de; + int_fast64_t wmod = state->wmod; long w = state->w; /* θ step (step 1 and 2 of 3). */ -#define X(N) C[N] = (A[N * 5] ^ A[N * 5 + 1]) ^ (A[N * 5 + 2] ^ A[N * 5 + 3]) ^ A[N * 5 + 4]; - LIST_25 +#define X(N) C[N] = A[N * 5] ^ A[N * 5 + 1] ^ A[N * 5 + 2] ^ A[N * 5 + 3] ^ A[N * 5 + 4]; + LIST_5 #undef X da = C[4] ^ rotate64(C[1], 1); @@ -143,7 +144,7 @@ void libkeccak_f_round(libkeccak_state_t* restrict state, int_fast64_t rc) static __attribute__((nonnull, nothrow, hot)) void libkeccak_f_round64(libkeccak_state_t* restrict state, int_fast64_t rc) { - int_fast64_t* restrict A = state->S; + register int_fast64_t* restrict A = state->S; int_fast64_t B[25]; int_fast64_t C[5]; int_fast64_t da, db, dc, dd, de; -- cgit v1.2.3-70-g09d2