]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix riscv64 carry bug in SM2 modulo reduction
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Sat, 4 Oct 2025 14:20:31 +0000 (16:20 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Sat, 4 Oct 2025 15:08:19 +0000 (17:08 +0200)
Fixes #28731

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28746)

crypto/ec/asm/ecp_sm2p256-riscv64.pl

index 0fb167530278022970cf9ccd0fdd05b94afc2dbe..2a17e124dc45b7c833bebc4a19a2750e0a474dc5 100644 (file)
@@ -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