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.hender...@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é <phi...@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