[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 27/37] target/arm: Use aesenc_MC
From: |
Richard Henderson |
Subject: |
[PULL 27/37] target/arm: Use aesenc_MC |
Date: |
Sun, 9 Jul 2023 14:59:35 +0100 |
This implements the AESMC instruction.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
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 d2cb74e7fc..1952aaac58 100644
--- a/target/arm/tcg/crypto_helper.c
+++ b/target/arm/tcg/crypto_helper.c
@@ -124,7 +124,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
- [PULL 20/37] target/i386: Use aesdec_ISB_ISR_AK, (continued)
- [PULL 20/37] target/i386: Use aesdec_ISB_ISR_AK, Richard Henderson, 2023/07/09
- [PULL 06/37] crypto: Add aesdec_ISB_ISR_AK, Richard Henderson, 2023/07/09
- [PULL 12/37] host/include/i386: Implement aes-round.h, Richard Henderson, 2023/07/09
- [PULL 11/37] crypto: Add aesdec_ISB_ISR_AK_IMC, Richard Henderson, 2023/07/09
- [PULL 16/37] target/ppc: Use aesdec_ISB_ISR_AK, Richard Henderson, 2023/07/09
- [PULL 13/37] host/include/aarch64: Implement aes-round.h, Richard Henderson, 2023/07/09
- [PULL 17/37] target/ppc: Use aesenc_SB_SR_MC_AK, Richard Henderson, 2023/07/09
- [PULL 18/37] target/ppc: Use aesdec_ISB_ISR_AK_IMC, Richard Henderson, 2023/07/09
- [PULL 22/37] target/i386: Use aesenc_SB_SR_MC_AK, Richard Henderson, 2023/07/09
- [PULL 24/37] target/arm: Demultiplex AESE and AESMC, Richard Henderson, 2023/07/09
- [PULL 27/37] target/arm: Use aesenc_MC,
Richard Henderson <=
- [PULL 34/37] crypto: Remove AES_shifts, AES_ishifts, Richard Henderson, 2023/07/09
- [PULL 30/37] target/riscv: Use aesdec_ISB_ISR_AK, Richard Henderson, 2023/07/09
- [PULL 35/37] crypto: Implement aesdec_IMC with AES_imc_rot, Richard Henderson, 2023/07/09
- [PULL 31/37] target/riscv: Use aesdec_IMC, Richard Henderson, 2023/07/09
- [PULL 19/37] target/i386: Use aesenc_SB_SR_AK, Richard Henderson, 2023/07/09
- [PULL 21/37] target/i386: Use aesdec_IMC, Richard Henderson, 2023/07/09
- [PULL 23/37] target/i386: Use aesdec_ISB_ISR_IMC_AK, Richard Henderson, 2023/07/09
- [PULL 25/37] target/arm: Use aesenc_SB_SR_AK, Richard Henderson, 2023/07/09
- [PULL 26/37] target/arm: Use aesdec_ISB_ISR_AK, Richard Henderson, 2023/07/09
- [PULL 28/37] target/arm: Use aesdec_IMC, Richard Henderson, 2023/07/09