aboutsummaryrefslogtreecommitdiffstats
path: root/marshal.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2019-02-10 20:57:56 +0100
committerMattias Andrée <maandree@kth.se>2019-02-10 20:57:56 +0100
commit15f132722cae63775dd7b2fef866d477c54c7b8e (patch)
tree27359241e0a1a0b6f304060bc0a9e7c9287efd06 /marshal.c
parentFirst commit (diff)
downloadlibsha1-15f132722cae63775dd7b2fef866d477c54c7b8e.tar.gz
libsha1-15f132722cae63775dd7b2fef866d477c54c7b8e.tar.bz2
libsha1-15f132722cae63775dd7b2fef866d477c54c7b8e.tar.xz
Implement SHA-0 and remove .chunk_size1.0
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--marshal.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/marshal.c b/marshal.c
index c2d1c11..adca8dc 100644
--- a/marshal.c
+++ b/marshal.c
@@ -33,11 +33,8 @@ libsha1_marshal(const struct libsha1_state *restrict state, void *restrict buf_)
off += sizeof(state->h);
if (buf)
- *(size_t *)&buf[off] = state->chunk_size;
- off += sizeof(size_t);
- if (buf)
- memcpy(&buf[off], state->chunk, (state->message_size / 8) % state->chunk_size);
- off += (state->message_size / 8) % state->chunk_size;
+ memcpy(&buf[off], state->chunk, (state->message_size / 8) % sizeof(state->chunk));
+ off += (state->message_size / 8) % sizeof(state->chunk);
return off;
}