aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-08-31 22:07:55 +0200
committerMattias Andrée <maandree@operamail.com>2015-08-31 22:07:55 +0200
commita3e5c3d49ce447c1009c2c1fcf70366d5764925c (patch)
tree4dc0a4ca789f54fa0306f37825ca0f8501b6deda /src
parentint*_t are guaranteed to use two's complete ... clean, understandable, and wonderful code (diff)
downloadlibkeccak-a3e5c3d49ce447c1009c2c1fcf70366d5764925c.tar.gz
libkeccak-a3e5c3d49ce447c1009c2c1fcf70366d5764925c.tar.bz2
libkeccak-a3e5c3d49ce447c1009c2c1fcf70366d5764925c.tar.xz
fix api bug: int_fastN_t depends on the c library, thus it must not be used in structs and prototypes
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/libkeccak/state.c10
-rw-r--r--src/libkeccak/state.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/libkeccak/state.c b/src/libkeccak/state.c
index 60a842d..46b43ae 100644
--- a/src/libkeccak/state.c
+++ b/src/libkeccak/state.c
@@ -42,7 +42,7 @@ int libkeccak_state_initialise(libkeccak_state_t* restrict state, const libkecca
if (x & 0x0CL) state->l |= 2, x >>= 2;
if (x & 0x02L) state->l |= 1;
state->nr = 12 + (state->l << 1);
- state->wmod = (state->w == 64) ? ~0LL : (int_fast64_t)((1ULL << state->w) - 1);
+ state->wmod = (state->w == 64) ? ~0LL : (int64_t)((1ULL << state->w) - 1);
for (x = 0; x < 25; x++)
state->S[x] = 0;
state->mptr = 0;
@@ -72,7 +72,7 @@ void libkeccak_state_wipe_message(volatile libkeccak_state_t* restrict state)
*/
void libkeccak_state_wipe_sponge(volatile libkeccak_state_t* restrict state)
{
- volatile int_fast64_t* restrict S = state->S;
+ volatile int64_t* restrict S = state->S;
size_t i;
for (i = 0; i < 25; i++)
S[i] = 0;
@@ -123,7 +123,7 @@ size_t libkeccak_state_marshal(const libkeccak_state_t* restrict state, char* re
set(long, n);
set(long, b);
set(long, w);
- set(int_fast64_t, wmod);
+ set(int64_t, wmod);
set(long, l);
set(long, nr);
memcpy(data, state->S, sizeof(state->S));
@@ -152,7 +152,7 @@ size_t libkeccak_state_unmarshal(libkeccak_state_t* restrict state, const char*
get(long, n);
get(long, b);
get(long, w);
- get(int_fast64_t, wmod);
+ get(int64_t, wmod);
get(long, l);
get(long, nr);
memcpy(state->S, data, sizeof(state->S));
@@ -178,7 +178,7 @@ size_t libkeccak_state_unmarshal(libkeccak_state_t* restrict state, const char*
*/
size_t libkeccak_state_unmarshal_skip(const char* restrict data)
{
- data += (7 * sizeof(long) + 26 * sizeof(int_fast64_t)) / sizeof(char);
+ data += (7 * sizeof(long) + 26 * sizeof(int64_t)) / sizeof(char);
return sizeof(libkeccak_state_t) - sizeof(char*) + *(const size_t*)data * sizeof(char);
}
diff --git a/src/libkeccak/state.h b/src/libkeccak/state.h
index 69a2455..21c7181 100644
--- a/src/libkeccak/state.h
+++ b/src/libkeccak/state.h
@@ -39,7 +39,7 @@ typedef struct libkeccak_state
/**
* The lanes (state/sponge)
*/
- int_fast64_t S[25];
+ int64_t S[25];
/**
* The bitrate
@@ -69,7 +69,7 @@ typedef struct libkeccak_state
/**
* The word mask
*/
- int_fast64_t wmod;
+ int64_t wmod;
/**
* ℓ, the binary logarithm of the word size