diff options
author | Mattias Andrée <maandree@kth.se> | 2022-01-08 22:57:27 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2022-01-08 22:57:27 +0100 |
commit | 12abd974fdf8362d41d688c478528c6b8047fa87 (patch) | |
tree | 096ace7f908e66089f379248e9fe036a85e4a1cb /libblake_blake2s_init.c | |
parent | Add last_node parameter to libblake_blake2[sb]_digest (diff) | |
download | libblake-12abd974fdf8362d41d688c478528c6b8047fa87.tar.gz libblake-12abd974fdf8362d41d688c478528c6b8047fa87.tar.bz2 libblake-12abd974fdf8362d41d688c478528c6b8047fa87.tar.xz |
Add BLAKE2X
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | libblake_blake2s_init.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/libblake_blake2s_init.c b/libblake_blake2s_init.c index d33ce5c..c4b126c 100644 --- a/libblake_blake2s_init.c +++ b/libblake_blake2s_init.c @@ -22,16 +22,9 @@ libblake_blake2s_init(struct libblake_blake2s_state *state, const struct libblak state->h[0] ^= ((uint_least32_t)params->key_len & 255) << 8; state->h[0] ^= ((uint_least32_t)params->fanout & 255) << 16; state->h[0] ^= ((uint_least32_t)params->depth & 255) << 24; - state->h[1] ^= ((uint_least32_t)(params->leaf_len >> 0) & 255) << 0; - state->h[1] ^= ((uint_least32_t)(params->leaf_len >> 8) & 255) << 8; - state->h[1] ^= ((uint_least32_t)(params->leaf_len >> 16) & 255) << 16; - state->h[1] ^= ((uint_least32_t)(params->leaf_len >> 24) & 255) << 24; - state->h[2] ^= ((uint_least32_t)(params->node_offset >> 0) & 255) << 0; - state->h[2] ^= ((uint_least32_t)(params->node_offset >> 8) & 255) << 8; - state->h[2] ^= ((uint_least32_t)(params->node_offset >> 16) & 255) << 16; - state->h[2] ^= ((uint_least32_t)(params->node_offset >> 24) & 255) << 24; - state->h[3] ^= ((uint_least32_t)(params->xof_len >> 0) & 255) << 0; - state->h[3] ^= ((uint_least32_t)(params->xof_len >> 8) & 255) << 8; + state->h[1] ^= params->leaf_len & UINT_LEAST32_C(0xFFFFffff); + state->h[2] ^= (uint_least32_t)((params->node_offset >> 0) & UINT_LEAST64_C(0xFFFFffff)); + state->h[3] ^= (uint_least32_t)((params->node_offset >> 32) & UINT_LEAST64_C(0xFFFF)) << 0; state->h[3] ^= ((uint_least32_t)params->node_depth & 255) << 16; state->h[3] ^= ((uint_least32_t)params->inner_len & 255) << 24; state->h[4] ^= ((uint_least32_t)params->salt[0] & 255) << 0; |