qemu-riscv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 33/37] target/riscv: Use aesdec_ISB_ISR_IMC_AK


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v4 33/37] target/riscv: Use aesdec_ISB_ISR_IMC_AK
Date: Sat, 8 Jul 2023 19:33:28 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0

On 3/7/23 12:05, Richard Henderson wrote:
This implements the AES64DSM instruction.  This was the last use
of aes64_operation and its support macros, so remove them all.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
  target/riscv/crypto_helper.c | 101 ++++-------------------------------
  1 file changed, 10 insertions(+), 91 deletions(-)


  target_ulong HELPER(aes64esm)(target_ulong rs1, target_ulong rs2)
  {
      AESState t;
@@ -228,7 +138,16 @@ target_ulong HELPER(aes64ds)(target_ulong rs1, 
target_ulong rs2)
target_ulong HELPER(aes64dsm)(target_ulong rs1, target_ulong rs2)
  {
-    return aes64_operation(rs1, rs2, false, true);
+    AESState t, z = { };

z can be const, otherwise:

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

+
+    /*
+     * This instruction does not include a round key,
+     * so supply a zero to our primitive.
+     */
+    t.d[HOST_BIG_ENDIAN] = rs1;
+    t.d[!HOST_BIG_ENDIAN] = rs2;
+    aesdec_ISB_ISR_IMC_AK(&t, &t, &z, false);
+    return t.d[HOST_BIG_ENDIAN];
  }
target_ulong HELPER(aes64ks2)(target_ulong rs1, target_ulong rs2)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]