From da9152b546d090875b769cd85b95681a4324541a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 25 Aug 2024 23:09:41 +0200 Subject: Fix optimised SHA1 implementation x86 intrinsic SHA1 instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- cgit v1.2.3-70-g09d2