diff options
author | Mattias Andrée <maandree@kth.se> | 2019-02-11 16:57:26 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2019-02-11 16:57:54 +0100 |
commit | 3547923d8653d72fe8a6a305107ed2e5dca6577c (patch) | |
tree | aa08e3ca8cb8d7f7b64126a6687af4abbe0994ef /libkeccak_state_unmarshal.c | |
parent | Split most .c files into one per function and flatten file hierarchy (diff) | |
download | libkeccak-3547923d8653d72fe8a6a305107ed2e5dca6577c.tar.gz libkeccak-3547923d8653d72fe8a6a305107ed2e5dca6577c.tar.bz2 libkeccak-3547923d8653d72fe8a6a305107ed2e5dca6577c.tar.xz |
Deprecate typedefs
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libkeccak_state_unmarshal.c')
-rw-r--r-- | libkeccak_state_unmarshal.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libkeccak_state_unmarshal.c b/libkeccak_state_unmarshal.c index 7177bd5..ca2013a 100644 --- a/libkeccak_state_unmarshal.c +++ b/libkeccak_state_unmarshal.c @@ -3,14 +3,14 @@ /** - * Unmarshal a `libkeccak_state_t` from a buffer + * Unmarshal a `struct libkeccak_state` from a buffer * * @param state The slot for the unmarshalled state, must not be initialised (memory leak otherwise) * @param data The input buffer * @return The number of bytes read from `data`, 0 on error */ size_t -libkeccak_state_unmarshal(libkeccak_state_t *restrict state, const void *restrict data_) +libkeccak_state_unmarshal(struct libkeccak_state *restrict state, const void *restrict data_) { #define get(type, var) state->var = *((const type *)data), data += sizeof(type) / sizeof(char) const char *restrict data = data_; @@ -31,6 +31,6 @@ libkeccak_state_unmarshal(libkeccak_state_t *restrict state, const void *restric return 0; memcpy(state->M, data, state->mptr * sizeof(char)); data += state->mptr; - return sizeof(libkeccak_state_t) - sizeof(char *) + state->mptr * sizeof(char); + return sizeof(struct libkeccak_state) - sizeof(char *) + state->mptr * sizeof(char); #undef get } |