aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-08-25 23:09:41 +0200
committerMattias Andrée <maandree@kth.se>2024-08-25 23:09:41 +0200
commitda9152b546d090875b769cd85b95681a4324541a (patch)
treebcbc744fa081775c4d392fc37edc0acdfadf19e9
parentBug and warning fix (diff)
downloadlibsha1-da9152b546d090875b769cd85b95681a4324541a.tar.gz
libsha1-da9152b546d090875b769cd85b95681a4324541a.tar.bz2
libsha1-da9152b546d090875b769cd85b95681a4324541a.tar.xz
Fix optimised SHA1 implementation x86 intrinsic SHA1 instructions1.1.2
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--process.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/process.c b/process.c
index 9fd3357..c91c00d 100644
--- a/process.c
+++ b/process.c
@@ -120,7 +120,7 @@ process_x86_sha(struct libsha1_state *restrict state, const unsigned char *restr
abcd_orig = _mm_shuffle_epi32(_mm_loadu_si128((const __m128i *)&state->h[0]), 32 - 5);
e000_orig = _mm_set_epi32((int)state->h[4], 0, 0, 0);
- for (; len >= off + sizeof(state->chunk); off += sizeof(state->chunk)) {
+ for (; len >= off + sizeof(state->chunk); off += sizeof(state->chunk), data = &data[sizeof(state->chunk)]) {
msg0 = _mm_loadu_si128((const __m128i *)&data[0]);
msg0 = _mm_shuffle_epi8(msg0, SHUFFLE_MASK);
e000 = _mm_add_epi32(e000_orig, msg0);