]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target/riscv: Use aesenc_SB_SR_MC_AK
authorRichard Henderson <richard.henderson@linaro.org>
Fri, 2 Jun 2023 21:14:04 +0000 (14:14 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Sun, 9 Jul 2023 12:47:17 +0000 (13:47 +0100)
This implements the AES64ESM instruction.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
target/riscv/crypto_helper.c

index 505166ce5a1487841d67a8f6d44cd55f08370090..c036fe8632ce31ac947f7d8447a9283f18a3513b 100644 (file)
@@ -198,7 +198,12 @@ static inline target_ulong aes64_operation(target_ulong rs1, target_ulong rs2,
 
 target_ulong HELPER(aes64esm)(target_ulong rs1, target_ulong rs2)
 {
-    return aes64_operation(rs1, rs2, true, true);
+    AESState t;
+
+    t.d[HOST_BIG_ENDIAN] = rs1;
+    t.d[!HOST_BIG_ENDIAN] = rs2;
+    aesenc_SB_SR_MC_AK(&t, &t, &aes_zero, false);
+    return t.d[HOST_BIG_ENDIAN];
 }
 
 target_ulong HELPER(aes64es)(target_ulong rs1, target_ulong rs2)