aboutsummaryrefslogtreecommitdiffstats
path: root/digest.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-07-08 00:47:04 +0200
committerMattias Andrée <maandree@kth.se>2022-07-08 00:47:04 +0200
commitc5b86d52256d535149caefbe1031807b28c8face (patch)
tree0f5b52e3196ca435365244b7cc3b97f9fb9750c5 /digest.c
parentm (diff)
downloadlibsha1-c5b86d52256d535149caefbe1031807b28c8face.tar.gz
libsha1-c5b86d52256d535149caefbe1031807b28c8face.tar.bz2
libsha1-c5b86d52256d535149caefbe1031807b28c8face.tar.xz
Add code using SHA intrinsics
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 0e9d117..0ad096c 100644
--- a/digest.c
+++ b/digest.c
@@ -29,7 +29,7 @@ libsha1_digest(struct libsha1_state *restrict state, const void *message_, size_
if (off > sizeof(state->chunk) - (size_t)8) {
memset(state->chunk + off, 0, sizeof(state->chunk) - off);
off = 0;
- libsha1_process(state, state->chunk);
+ libsha1_process(state, state->chunk, sizeof(state->chunk));
}
memset(state->chunk + off, 0, sizeof(state->chunk) - 8 - off);
@@ -41,7 +41,7 @@ libsha1_digest(struct libsha1_state *restrict state, const void *message_, size_
state->chunk[sizeof(state->chunk) - 3] = (unsigned char)(state->message_size >> 16);
state->chunk[sizeof(state->chunk) - 2] = (unsigned char)(state->message_size >> 8);
state->chunk[sizeof(state->chunk) - 1] = (unsigned char)(state->message_size >> 0);
- libsha1_process(state, state->chunk);
+ libsha1_process(state, state->chunk, sizeof(state->chunk));
n = libsha1_algorithm_output_size(state->algorithm);
for (i = 0, n /= 4; i < n; i++) {