aboutsummaryrefslogtreecommitdiffstats
path: root/digest.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-07-08 13:23:00 +0200
committerMattias Andrée <maandree@kth.se>2022-07-08 13:23:00 +0200
commit312a92b5104fd5e9090bc079f458f9105a91e1ea (patch)
treea2f68787a2a3ffaf5ca17661c503daebd96bc453 /digest.c
parentUse uint_leastN_t instead of uintN_t (diff)
downloadlibsha2-312a92b5104fd5e9090bc079f458f9105a91e1ea.tar.gz
libsha2-312a92b5104fd5e9090bc079f458f9105a91e1ea.tar.bz2
libsha2-312a92b5104fd5e9090bc079f458f9105a91e1ea.tar.xz
Use SHA extensions1.1
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--digest.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/digest.c b/digest.c
index a60da1c..2a611d6 100644
--- a/digest.c
+++ b/digest.c
@@ -29,7 +29,7 @@ libsha2_digest(struct libsha2_state *restrict state, const void *message_, size_
if (off > state->chunk_size - (size_t)8 * (size_t)(1 + (state->algorithm > LIBSHA2_256))) {
memset(state->chunk + off, 0, state->chunk_size - off);
off = 0;
- libsha2_process(state, state->chunk);
+ libsha2_process(state, state->chunk, state->chunk_size);
}
memset(state->chunk + off, 0, state->chunk_size - 8 - off);
@@ -41,7 +41,7 @@ libsha2_digest(struct libsha2_state *restrict state, const void *message_, size_
state->chunk[state->chunk_size - 3] = (unsigned char)(state->message_size >> 16);
state->chunk[state->chunk_size - 2] = (unsigned char)(state->message_size >> 8);
state->chunk[state->chunk_size - 1] = (unsigned char)(state->message_size >> 0);
- libsha2_process(state, state->chunk);
+ libsha2_process(state, state->chunk, state->chunk_size);
n = libsha2_algorithm_output_size(state->algorithm);
if (state->algorithm <= LIBSHA2_256) {