aboutsummaryrefslogtreecommitdiffstats
path: root/libblake_blake2b_init.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-05-17 19:52:13 +0200
committerMattias Andrée <m@maandree.se>2026-05-17 19:52:13 +0200
commit4ad308fca3010379cb4a47023635fb2fcabb63a3 (patch)
tree37318829e4ee505509116eae697cfda22345accb /libblake_blake2b_init.c
parentFix alignment issues found by gcc santizer, and aliasing issue (diff)
downloadlibblake-3.0.2.tar.gz
libblake-3.0.2.tar.bz2
libblake-3.0.2.tar.xz
Fix undefined behaviour3.0.2
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rw-r--r--libblake_blake2b_init.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libblake_blake2b_init.c b/libblake_blake2b_init.c
index 9670bc3..9f22b12 100644
--- a/libblake_blake2b_init.c
+++ b/libblake_blake2b_init.c
@@ -42,8 +42,8 @@ libblake_blake2b_init(struct libblake_blake2b_state *state, const struct libblak
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wcast-align"
#endif
- state->h[0] ^= le64(((const uint_least64_t *)params)[0]);
- state->h[1] ^= le64(((const uint_least64_t *)params)[1]);
+ state->h[0] ^= le64(((const uint_least64_t *)(const unsigned char *)params)[0]);
+ state->h[1] ^= le64(((const uint_least64_t *)(const unsigned char *)params)[1]);
state->h[2] ^= le64(((uint_least64_t)params->node_depth << 0) |
((uint_least64_t)params->inner_len << 8));
state->h[4] ^= le64(*(const uint_least64_t *)&params->salt[0]);