aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-11-06 22:10:37 +0100
committerMattias Andrée <maandree@operamail.com>2014-11-06 22:10:37 +0100
commit4585961deef4469a8d4008e926881bc87b4e1a78 (patch)
treef29f587b98b46e13c458029219a3a7edf531ac36 /src
parentadd run-benchmark rule (diff)
downloadlibkeccak-4585961deef4469a8d4008e926881bc87b4e1a78.tar.gz
libkeccak-4585961deef4469a8d4008e926881bc87b4e1a78.tar.bz2
libkeccak-4585961deef4469a8d4008e926881bc87b4e1a78.tar.xz
fix bug
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r--src/libkeccak/digest.c9
1 files changed, 5 insertions, 4 deletions
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;