[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 16/35] target/arm: Use aesenc_MC
From: |
Richard Henderson |
Subject: |
[PATCH 16/35] target/arm: Use aesenc_MC |
Date: |
Fri, 2 Jun 2023 19:34:07 -0700 |
This implements the AESMC instruction.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/tcg/crypto_helper.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/target/arm/tcg/crypto_helper.c b/target/arm/tcg/crypto_helper.c
index d7b644851f..a0fec08771 100644
--- a/target/arm/tcg/crypto_helper.c
+++ b/target/arm/tcg/crypto_helper.c
@@ -118,7 +118,20 @@ void HELPER(crypto_aesmc)(void *vd, void *vm, uint32_t
desc)
intptr_t i, opr_sz = simd_oprsz(desc);
for (i = 0; i < opr_sz; i += 16) {
- do_crypto_aesmc(vd + i, vm + i, AES_mc_rot);
+ AESState *ad = (AESState *)(vd + i);
+ AESState *st = (AESState *)(vm + i);
+ AESState t;
+
+ /* Our uint64_t are in the wrong order for big-endian. */
+ if (HOST_BIG_ENDIAN) {
+ t.d[0] = st->d[1];
+ t.d[1] = st->d[0];
+ aesenc_MC(&t, &t, false);
+ ad->d[0] = t.d[1];
+ ad->d[1] = t.d[0];
+ } else {
+ aesenc_MC(ad, st, false);
+ }
}
clear_tail(vd, opr_sz, simd_maxsz(desc));
}
--
2.34.1
- [PATCH 24/35] target/riscv: Use aesenc_SB_SR_MC_AK, (continued)
- [PATCH 24/35] target/riscv: Use aesenc_SB_SR_MC_AK, Richard Henderson, 2023/06/02
- [PATCH 26/35] target/i386: Use aesdec_ISB_ISR_IMC_AK, Richard Henderson, 2023/06/02
- [PATCH 25/35] crypto: Add aesdec_ISB_ISR_IMC_AK, Richard Henderson, 2023/06/02
- [PATCH 14/35] target/riscv: Use aesdec_ISB_ISR, Richard Henderson, 2023/06/02
- [PATCH 27/35] target/riscv: Use aesdec_ISB_ISR_IMC_AK, Richard Henderson, 2023/06/02
- [PATCH 30/35] host/include/i386: Implement aes-round.h, Richard Henderson, 2023/06/02
- [PATCH 15/35] crypto: Add aesenc_MC, Richard Henderson, 2023/06/02
- [PATCH 31/35] host/include/aarch64: Implement aes-round.h, Richard Henderson, 2023/06/02
- [PATCH 16/35] target/arm: Use aesenc_MC,
Richard Henderson <=
- [PATCH 34/35] crypto: Remove AES_imc, Richard Henderson, 2023/06/02
- [PATCH 35/35] crypto: Unexport AES_*_rot, AES_TeN, AES_TdN, Richard Henderson, 2023/06/02
- [PATCH 18/35] target/i386: Use aesdec_IMC, Richard Henderson, 2023/06/02
- [PATCH 20/35] target/riscv: Use aesdec_IMC, Richard Henderson, 2023/06/02
- [PATCH 22/35] target/i386: Use aesenc_SB_SR_MC_AK, Richard Henderson, 2023/06/02
- [PATCH 19/35] target/arm: Use aesdec_IMC, Richard Henderson, 2023/06/02
- [PATCH 29/35] target/ppc: Use aesdec_ISB_ISR_AK_IMC, Richard Henderson, 2023/06/02
- [PATCH 32/35] crypto: Remove AES_shifts, AES_ishifts, Richard Henderson, 2023/06/02
- [PATCH 28/35] crypto: Add aesdec_ISB_ISR_AK_IMC, Richard Henderson, 2023/06/02
- [PATCH 33/35] crypto: Implement aesdec_IMC with AES_imc_rot, Richard Henderson, 2023/06/02