From ef14d114179a33ed4e21410b9bcedb06af714072 Mon Sep 17 00:00:00 2001 From: Rupinder Sahi Date: Thu, 9 Jul 2026 21:30:20 +0000 Subject: [PATCH] Fix SHA3_squeeze state handling for OpenSSL 3.5.7 integration Signed-off-by: Rupinder Sahi --- .../Linux/crypto/sha/keccak1600-x86_64.s | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/openssl_source/Linux/crypto/sha/keccak1600-x86_64.s b/openssl_source/Linux/crypto/sha/keccak1600-x86_64.s index f6b852fb..0b959b9b 100644 --- a/openssl_source/Linux/crypto/sha/keccak1600-x86_64.s +++ b/openssl_source/Linux/crypto/sha/keccak1600-x86_64.s @@ -453,10 +453,12 @@ SHA3_squeeze: .cfi_offset %r14,-32 shrq $3,%rcx - movq %rdi,%r8 + movq %rdi,%r9 movq %rsi,%r12 movq %rdx,%r13 movq %rcx,%r14 + btl $0,%r8d + jc .Lnext_block jmp .Loop_squeeze .align 32 @@ -464,8 +466,8 @@ SHA3_squeeze: cmpq $8,%r13 jb .Ltail_squeeze - movq (%r8),%rax - leaq 8(%r8),%r8 + movq (%r9),%rax + leaq 8(%r9),%r9 movq %rax,(%r12) leaq 8(%r12),%r12 subq $8,%r13 @@ -474,17 +476,18 @@ SHA3_squeeze: subq $1,%rcx jnz .Loop_squeeze + +.Lnext_block: call KeccakF1600 - movq %rdi,%r8 + movq %rdi,%r9 movq %r14,%rcx jmp .Loop_squeeze .Ltail_squeeze: - movq %r8,%rsi + movq %r9,%rsi movq %r12,%rdi movq %r13,%rcx .byte 0xf3,0xa4 - lfence # mgadd load_only .Ldone_squeeze: popq %r14