diff options
Diffstat (limited to 'libblake_blake2s_digest.c')
-rw-r--r-- | libblake_blake2s_digest.c | 5 |
1 files changed, 4 insertions, 1 deletions
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); |