diff options
author | Mattias Andrée <maandree@kth.se> | 2022-01-08 10:13:28 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2022-01-08 10:13:28 +0100 |
commit | fb527a8eb943bf7efdf6dc858c9fd88a3fcdbd19 (patch) | |
tree | adb5310a9cceaf24b460db710f350671c55c8995 /libblake_blake2s_digest.c | |
parent | m (diff) | |
download | libblake-fb527a8eb943bf7efdf6dc858c9fd88a3fcdbd19.tar.gz libblake-fb527a8eb943bf7efdf6dc858c9fd88a3fcdbd19.tar.bz2 libblake-fb527a8eb943bf7efdf6dc858c9fd88a3fcdbd19.tar.xz |
Add last_node parameter to libblake_blake2[sb]_digest
Signed-off-by: Mattias Andrée <maandree@kth.se>
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); |