[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 29/35] target/ppc: Use aesdec_ISB_ISR_AK_IMC
From: |
Richard Henderson |
Subject: |
[PATCH 29/35] target/ppc: Use aesdec_ISB_ISR_AK_IMC |
Date: |
Fri, 2 Jun 2023 19:34:20 -0700 |
This implements the VNCIPHER instruction.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/ppc/int_helper.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c
index c7f8b39e9a..8ae10ad748 100644
--- a/target/ppc/int_helper.c
+++ b/target/ppc/int_helper.c
@@ -2953,22 +2953,11 @@ void helper_vcipherlast(ppc_avr_t *r, ppc_avr_t *a,
ppc_avr_t *b)
void helper_vncipher(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
{
- /* This differs from what is written in ISA V2.07. The RTL is */
- /* incorrect and will be fixed in V2.07B. */
- int i;
- ppc_avr_t tmp;
+ AESState *ad = (AESState *)r;
+ AESState *st = (AESState *)a;
+ AESState *rk = (AESState *)b;
- VECTOR_FOR_INORDER_I(i, u8) {
- tmp.VsrB(i) = b->VsrB(i) ^ AES_isbox[a->VsrB(AES_ishifts[i])];
- }
-
- VECTOR_FOR_INORDER_I(i, u32) {
- r->VsrW(i) =
- AES_imc[tmp.VsrB(4 * i + 0)][0] ^
- AES_imc[tmp.VsrB(4 * i + 1)][1] ^
- AES_imc[tmp.VsrB(4 * i + 2)][2] ^
- AES_imc[tmp.VsrB(4 * i + 3)][3];
- }
+ aesdec_ISB_ISR_AK_IMC(ad, st, rk, true);
}
void helper_vncipherlast(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
--
2.34.1
- [PATCH 31/35] host/include/aarch64: Implement aes-round.h, (continued)
- [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, 2023/06/02
- [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 <=
- [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
- Re: [PATCH 00/35] crypto: Provide aes-round.h and host accel, Ard Biesheuvel, 2023/06/03