From 521ae4abf3931ddb78ae22b2fbf0983c8f447727 Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Sat, 4 Oct 2025 16:20:31 +0200 Subject: [PATCH] Fix riscv64 carry bug in SM2 modulo reduction MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes #28731 Reviewed-by: Neil Horman Reviewed-by: Saša Nedvědický (Merged from https://github.com/openssl/openssl/pull/28746) --- crypto/ec/asm/ecp_sm2p256-riscv64.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/ec/asm/ecp_sm2p256-riscv64.pl b/crypto/ec/asm/ecp_sm2p256-riscv64.pl index 0fb16753027..2a17e124dc4 100644 --- a/crypto/ec/asm/ecp_sm2p256-riscv64.pl +++ b/crypto/ec/asm/ecp_sm2p256-riscv64.pl @@ -881,6 +881,7 @@ $code.=<<___; add $t1, $t1, $s6 sltu $c2, $t1, $s6 add $t1, $t1, $c1 + sltu $c1, $t1, $c1 add $c1, $c1, $c2 add $t2, $t2, $c1 sltu $c1, $t2, $c1 -- 2.47.3