diff options
author | Mattias Andrée <maandree@kth.se> | 2019-02-10 13:48:27 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2019-02-10 13:48:27 +0100 |
commit | 7f5da97d1078fbeee7ef6125802ab2c7092079e0 (patch) | |
tree | b29926c0c1c07ad3cfd543fa3a4eedf5a60b385a /marshal.c | |
parent | Add test cases (diff) | |
download | libsha2-7f5da97d1078fbeee7ef6125802ab2c7092079e0.tar.gz libsha2-7f5da97d1078fbeee7ef6125802ab2c7092079e0.tar.bz2 libsha2-7f5da97d1078fbeee7ef6125802ab2c7092079e0.tar.xz |
Minor fixes and tests
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'marshal.c')
-rw-r--r-- | marshal.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -50,8 +50,8 @@ libsha2_marshal(const struct libsha2_state *restrict state, char *restrict buf) *(size_t *)&buf[off] = state->chunk_size; off += sizeof(size_t); if (buf) - memcpy(&buf[off], state->chunk, state->message_size % state->chunk_size); - off += state->message_size % state->chunk_size; + memcpy(&buf[off], state->chunk, (state->message_size / 8) % state->chunk_size); + off += (state->message_size / 8) % state->chunk_size; return off; } |