aboutsummaryrefslogtreecommitdiffstats
path: root/marshal.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-07-07 15:26:10 +0200
committerMattias Andrée <maandree@kth.se>2022-07-07 15:26:10 +0200
commit17468588ff3a907f16dca4155b0a15bd8e82109a (patch)
tree763cbfc90cf0513aa4964cace43dde3be1230a75 /marshal.c
parentRemove documentation from .c files that already exist in .h files (diff)
downloadlibsha2-17468588ff3a907f16dca4155b0a15bd8e82109a.tar.gz
libsha2-17468588ff3a907f16dca4155b0a15bd8e82109a.tar.bz2
libsha2-17468588ff3a907f16dca4155b0a15bd8e82109a.tar.xz
Don't marshal w
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/marshal.c b/marshal.c
index ae9ce52..7596c03 100644
--- a/marshal.c
+++ b/marshal.c
@@ -9,7 +9,7 @@ libsha2_marshal(const struct libsha2_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 libsha2_algorithm *)&buf[off] = state->algorithm;
@@ -23,9 +23,6 @@ libsha2_marshal(const struct libsha2_state *restrict state, void *restrict buf_)
memcpy(&buf[off], state->k.b32, sizeof(state->k.b32));
off += sizeof(state->k.b32);
if (buf)
- memcpy(&buf[off], state->w.b32, sizeof(state->w.b32));
- off += sizeof(state->w.b32);
- if (buf)
memcpy(&buf[off], state->h.b32, sizeof(state->h.b32));
off += sizeof(state->h.b32);
} else {
@@ -33,9 +30,6 @@ libsha2_marshal(const struct libsha2_state *restrict state, void *restrict buf_)
memcpy(&buf[off], state->k.b64, sizeof(state->k.b64));
off += sizeof(state->k.b64);
if (buf)
- memcpy(&buf[off], state->w.b64, sizeof(state->w.b64));
- off += sizeof(state->w.b64);
- if (buf)
memcpy(&buf[off], state->h.b64, sizeof(state->h.b64));
off += sizeof(state->h.b64);
}