From fb527a8eb943bf7efdf6dc858c9fd88a3fcdbd19 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 8 Jan 2022 10:13:28 +0100 Subject: Add last_node parameter to libblake_blake2[sb]_digest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libblake_blake2s_digest.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libblake_blake2s_digest.c') diff --git a/libblake_blake2s_digest.c b/libblake_blake2s_digest.c index d9106a5..29a31a6 100644 --- a/libblake_blake2s_digest.c +++ b/libblake_blake2s_digest.c @@ -23,7 +23,7 @@ encode_uint32_le(unsigned char *out, uint_least32_t value, size_t bytes) } void -libblake_blake2s_digest(struct libblake_blake2s_state *state, void *data_, size_t len, +libblake_blake2s_digest(struct libblake_blake2s_state *state, void *data_, size_t len, int last_node, size_t output_len, unsigned char output[static output_len]) { unsigned char *data = data_; @@ -34,6 +34,9 @@ libblake_blake2s_digest(struct libblake_blake2s_state *state, void *data_, size_ len -= r; state->f[0] = UINT_LEAST32_C(0xFFFFffff); + if (last_node) + state->f[1] = UINT_LEAST32_C(0xFFFFffff); + memset(&data[len], 0, 64 - len); state->t[0] = (state->t[0] + len) & UINT_LEAST32_C(0xFFFFffff); -- cgit v1.2.3-70-g09d2