diff --git a/src/crypto/internal/fips140/sha512/sha512block_riscv64.s b/src/crypto/internal/fips140/sha512/sha512block_riscv64.s
index 2b156271e67105175b816f825354ff0c7e6d805f..f25ed62237bd0c478e0c15b4f36d20254f820c9f 100644
--- a/src/crypto/internal/fips140/sha512/sha512block_riscv64.s
+++ b/src/crypto/internal/fips140/sha512/sha512block_riscv64.s
@@ -138,9 +138,8 @@
 #define SHA512ROUND(index, a, b, c, d, e, f, g, h) \
 	SHA512T1(index, e, f, g, h); \
 	SHA512T2(a, b, c); \
-	MOV	X6, h; \
 	ADD	X5, d; \
-	ADD	X5, h
+	ADD	X6, X5, h
 
 #define SHA512ROUND0(index, a, b, c, d, e, f, g, h) \
 	MSGSCHEDULE0(index); \