[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 31/37] target/riscv: Use aesdec_IMC
From: |
Richard Henderson |
Subject: |
[PULL 31/37] target/riscv: Use aesdec_IMC |
Date: |
Sun, 9 Jul 2023 19:29:14 +0100 |
This implements the AES64IM instruction.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/riscv/crypto_helper.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/target/riscv/crypto_helper.c b/target/riscv/crypto_helper.c
index e61f7fe1e5..505166ce5a 100644
--- a/target/riscv/crypto_helper.c
+++ b/target/riscv/crypto_helper.c
@@ -272,17 +272,12 @@ target_ulong HELPER(aes64ks1i)(target_ulong rs1,
target_ulong rnum)
target_ulong HELPER(aes64im)(target_ulong rs1)
{
- uint64_t RS1 = rs1;
- uint32_t col_0 = RS1 & 0xFFFFFFFF;
- uint32_t col_1 = RS1 >> 32;
- target_ulong result;
+ AESState t;
- col_0 = AES_INVMIXCOLUMN(col_0);
- col_1 = AES_INVMIXCOLUMN(col_1);
-
- result = ((uint64_t)col_1 << 32) | col_0;
-
- return result;
+ t.d[HOST_BIG_ENDIAN] = rs1;
+ t.d[!HOST_BIG_ENDIAN] = 0;
+ aesdec_IMC(&t, &t, false);
+ return t.d[HOST_BIG_ENDIAN];
}
target_ulong HELPER(sm4ed)(target_ulong rs1, target_ulong rs2,
--
2.34.1
- [PULL 35/37] crypto: Implement aesdec_IMC with AES_imc_rot, (continued)
- [PULL 35/37] crypto: Implement aesdec_IMC with AES_imc_rot, Richard Henderson, 2023/07/09
- [PATCH 41/45] accel/tcg: Return bool from page_check_range, Richard Henderson, 2023/07/09
- [PATCH 42/45] linux-user: Remove can_passthrough_madvise, Richard Henderson, 2023/07/09
- [PULL 26/37] target/arm: Use aesdec_ISB_ISR_AK, Richard Henderson, 2023/07/09
- [PATCH 38/45] linux-user: Rename mmap_reserve to mmap_reserve_or_unmap, Richard Henderson, 2023/07/09
- [PATCH 39/45] linux-user: Simplify target_munmap, Richard Henderson, 2023/07/09
- [PATCH 24/45] linux-user: Split TARGET_PROT_* out of syscall_defs.h, Richard Henderson, 2023/07/09
- [PULL 29/37] target/riscv: Use aesenc_SB_SR_AK, Richard Henderson, 2023/07/09
- [PULL 36/37] crypto: Remove AES_imc, Richard Henderson, 2023/07/09
- [PATCH 37/45] linux-user: Rewrite mmap_reserve, Richard Henderson, 2023/07/09
- [PULL 31/37] target/riscv: Use aesdec_IMC,
Richard Henderson <=
- [PATCH 31/45] linux-user: Rewrite target_mprotect, Richard Henderson, 2023/07/09
- [PATCH 43/45] linux-user: Simplify target_madvise, Richard Henderson, 2023/07/09
- [PATCH 44/45] linux-user: Drop uint and ulong, Richard Henderson, 2023/07/09
- [PATCH 45/45] linux-user/riscv: Add syscall riscv_hwprobe, Richard Henderson, 2023/07/09