From 235382a457f42655fd450169ab3b3d90d1148ff6 Mon Sep 17 00:00:00 2001 From: Sun Yimin Date: Mon, 2 Sep 2024 13:18:08 +0800 Subject: [PATCH] internal/subtle: fix riscv64 --- internal/sm2ec/fiat/sm2p256scalar_test.go | 2 -- internal/subtle/xor_riscv64.s | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/sm2ec/fiat/sm2p256scalar_test.go b/internal/sm2ec/fiat/sm2p256scalar_test.go index 80a427a..87fcca9 100644 --- a/internal/sm2ec/fiat/sm2p256scalar_test.go +++ b/internal/sm2ec/fiat/sm2p256scalar_test.go @@ -2,9 +2,7 @@ package fiat_test import ( "bytes" - "crypto/rand" "encoding/hex" - "fmt" "math/big" "testing" diff --git a/internal/subtle/xor_riscv64.s b/internal/subtle/xor_riscv64.s index bdf38cb..86752dd 100644 --- a/internal/subtle/xor_riscv64.s +++ b/internal/subtle/xor_riscv64.s @@ -46,7 +46,7 @@ less_than4: MOVHU (X6), X10 MOVHU (X7), X11 XOR X10, X11, X10 - MOVHU X10, (X5) + MOVH X10, (X5) ADD $2, X5 ADD $2, X6 ADD $2, X7 @@ -57,7 +57,7 @@ less_than2: MOVBU (X6), X10 MOVBU (X7), X11 XOR X10, X11, X10 - MOVBU X10, (X5) + MOVB X10, (X5) done: RET