aboutsummaryrefslogtreecommitdiffstats
path: root/hmac_marshal.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-05-17 21:02:39 +0200
committerMattias Andrée <m@maandree.se>2026-05-17 21:02:39 +0200
commit5fb2a5fe67521a452463e6b91cee406ec14c35a0 (patch)
treef6be3a0c9086ef7122a7d5789818bdc7c0bb1081 /hmac_marshal.c
parentUpdate year (diff)
downloadlibsha2-b5a4c67f7b6cb0ba294eafcba7ae4e3cb91f60dd.tar.gz
libsha2-b5a4c67f7b6cb0ba294eafcba7ae4e3cb91f60dd.tar.bz2
libsha2-b5a4c67f7b6cb0ba294eafcba7ae4e3cb91f60dd.tar.xz
Fix mistakesHEAD1.1.5master
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'hmac_marshal.c')
-rw-r--r--hmac_marshal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hmac_marshal.c b/hmac_marshal.c
index 6db8972..e234f76 100644
--- a/hmac_marshal.c
+++ b/hmac_marshal.c
@@ -5,21 +5,21 @@
size_t
libsha2_hmac_marshal(const struct libsha2_hmac_state *restrict state, void *restrict buf_)
{
- char *restrict buf = buf_;
+ unsigned char *restrict buf = buf_;
size_t off = 0;
if (buf)
- *(int *)buf = 0; /* version */
+ memcpy(buf, &(int){0}, sizeof(int)); /* version */
off += sizeof(int);
off += libsha2_marshal(&state->sha2_state, buf ? &buf[off] : NULL);
if (buf)
- *(size_t *)&buf[off] = state->outsize;
+ memcpy(&buf[off], &state->outsize, sizeof(size_t));
off += sizeof(size_t);
if (buf)
- *(unsigned char *)&buf[off] = state->inited;
+ buf[off] = state->inited;
off += sizeof(unsigned char);
if (buf)