aboutsummaryrefslogtreecommitdiffstats
path: root/marshal.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-07-07 14:13:27 +0200
committerMattias Andrée <maandree@kth.se>2022-07-07 14:13:27 +0200
commit8cedc519bf235a52e2c85cd06bb0ec7d392bf0ca (patch)
tree539b994009afb20a537148d4236b6d443e06fba0 /marshal.c
parentRemove documentation from .c files that already exist in .h files (diff)
downloadlibsha1-8cedc519bf235a52e2c85cd06bb0ec7d392bf0ca.tar.gz
libsha1-8cedc519bf235a52e2c85cd06bb0ec7d392bf0ca.tar.bz2
libsha1-8cedc519bf235a52e2c85cd06bb0ec7d392bf0ca.tar.xz
Don't marshal w
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/marshal.c b/marshal.c
index adca8dc..9c01211 100644
--- a/marshal.c
+++ b/marshal.c
@@ -2,13 +2,6 @@
#include "common.h"
-/**
- * Marshal a state into a buffer
- *
- * @param state The state to marshal
- * @param buf Output buffer, `NULL` to only return the required size
- * @return The number of bytes marshalled to `buf`
- */
size_t
libsha1_marshal(const struct libsha1_state *restrict state, void *restrict buf_)
{
@@ -16,7 +9,7 @@ libsha1_marshal(const struct libsha1_state *restrict state, void *restrict buf_)
size_t off = 0;
if (buf)
- *(int *)buf = 0; /* version */
+ *(int *)buf = 1; /* version */
off += sizeof(int);
if (buf)
*(enum libsha1_algorithm *)&buf[off] = state->algorithm;
@@ -26,9 +19,6 @@ libsha1_marshal(const struct libsha1_state *restrict state, void *restrict buf_)
off += sizeof(size_t);
if (buf)
- memcpy(&buf[off], state->w, sizeof(state->w));
- off += sizeof(state->w);
- if (buf)
memcpy(&buf[off], state->h, sizeof(state->h));
off += sizeof(state->h);