[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/35] target/riscv: Use aesenc_SB_SR
From: |
Richard Henderson |
Subject: |
[PATCH 09/35] target/riscv: Use aesenc_SB_SR |
Date: |
Fri, 2 Jun 2023 19:34:00 -0700 |
This implements the AES64ES instruction.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/riscv/crypto_helper.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/target/riscv/crypto_helper.c b/target/riscv/crypto_helper.c
index 2ef30281b1..82d7f3a060 100644
--- a/target/riscv/crypto_helper.c
+++ b/target/riscv/crypto_helper.c
@@ -22,6 +22,7 @@
#include "exec/exec-all.h"
#include "exec/helper-proto.h"
#include "crypto/aes.h"
+#include "crypto/aes-round.h"
#include "crypto/sm4.h"
#define AES_XTIME(a) \
@@ -200,7 +201,12 @@ target_ulong HELPER(aes64esm)(target_ulong rs1,
target_ulong rs2)
target_ulong HELPER(aes64es)(target_ulong rs1, target_ulong rs2)
{
- return aes64_operation(rs1, rs2, true, false);
+ AESState t;
+
+ t.d[HOST_BIG_ENDIAN] = rs1;
+ t.d[!HOST_BIG_ENDIAN] = rs2;
+ aesenc_SB_SR(&t, &t, false);
+ return t.d[HOST_BIG_ENDIAN];
}
target_ulong HELPER(aes64ds)(target_ulong rs1, target_ulong rs2)
--
2.34.1
- [PATCH 03/35] crypto/aes: Add constants for ShiftRows, InvShiftRows, (continued)
- [PATCH 03/35] crypto/aes: Add constants for ShiftRows, InvShiftRows, Richard Henderson, 2023/06/02
- [PATCH 04/35] crypto: Add aesenc_SB_SR, Richard Henderson, 2023/06/02
- [PATCH 07/35] target/arm: Use aesenc_SB_SR, Richard Henderson, 2023/06/02
- [PATCH 08/35] target/ppc: Use aesenc_SB_SR, Richard Henderson, 2023/06/02
- [PATCH 06/35] target/arm: Demultiplex AESE and AESMC, Richard Henderson, 2023/06/02
- [PATCH 13/35] target/ppc: Use aesdec_ISB_ISR, Richard Henderson, 2023/06/02
- [PATCH 09/35] target/riscv: Use aesenc_SB_SR,
Richard Henderson <=
- [PATCH 10/35] crypto: Add aesdec_ISB_ISR, Richard Henderson, 2023/06/02
- [PATCH 05/35] target/i386: Use aesenc_SB_SR, Richard Henderson, 2023/06/02
- [PATCH 11/35] target/i386: Use aesdec_ISB_ISR, Richard Henderson, 2023/06/02
- [PATCH 14/35] target/riscv: Use aesdec_ISB_ISR, Richard Henderson, 2023/06/02
- [PATCH 15/35] crypto: Add aesenc_MC, Richard Henderson, 2023/06/02
- [PATCH 16/35] target/arm: Use aesenc_MC, Richard Henderson, 2023/06/02
- [PATCH 12/35] target/arm: Use aesdec_ISB_ISR, Richard Henderson, 2023/06/02
- [PATCH 18/35] target/i386: Use aesdec_IMC, Richard Henderson, 2023/06/02
- [PATCH 21/35] crypto: Add aesenc_SB_SR_MC_AK, Richard Henderson, 2023/06/02
- [PATCH 23/35] target/ppc: Use aesenc_SB_SR_MC_AK, Richard Henderson, 2023/06/02