diff options
author | Mattias Andrée <maandree@kth.se> | 2022-07-08 00:47:04 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2022-07-08 00:47:04 +0200 |
commit | c5b86d52256d535149caefbe1031807b28c8face (patch) | |
tree | 0f5b52e3196ca435365244b7cc3b97f9fb9750c5 /digest.c | |
parent | m (diff) | |
download | libsha1-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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++) { |