[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 25/38] target/ppc: Use aesenc_SB_SR_MC_AK
From: |
Richard Henderson |
Subject: |
[PATCH v2 25/38] target/ppc: Use aesenc_SB_SR_MC_AK |
Date: |
Thu, 8 Jun 2023 19:23:48 -0700 |
This implements the VCIPHER instruction.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/ppc/int_helper.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c
index 15f07fca2b..1e477924b7 100644
--- a/target/ppc/int_helper.c
+++ b/target/ppc/int_helper.c
@@ -2933,17 +2933,11 @@ void helper_vsbox(ppc_avr_t *r, ppc_avr_t *a)
void helper_vcipher(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
{
- ppc_avr_t result;
- int i;
+ AESState *ad = (AESState *)r;
+ AESState *st = (AESState *)a;
+ AESState *rk = (AESState *)b;
- VECTOR_FOR_INORDER_I(i, u32) {
- result.VsrW(i) = b->VsrW(i) ^
- (AES_Te0[a->VsrB(AES_shifts[4 * i + 0])] ^
- AES_Te1[a->VsrB(AES_shifts[4 * i + 1])] ^
- AES_Te2[a->VsrB(AES_shifts[4 * i + 2])] ^
- AES_Te3[a->VsrB(AES_shifts[4 * i + 3])]);
- }
- *r = result;
+ aesenc_SB_SR_MC_AK(ad, st, rk, true);
}
void helper_vcipherlast(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
--
2.34.1
- [PATCH v2 20/38] target/i386: Use aesdec_IMC, (continued)
- [PATCH v2 20/38] target/i386: Use aesdec_IMC, Richard Henderson, 2023/06/08
- [PATCH v2 27/38] crypto: Add aesdec_ISB_ISR_IMC_AK, Richard Henderson, 2023/06/08
- [PATCH v2 19/38] crypto: Add aesdec_IMC, Richard Henderson, 2023/06/08
- [PATCH v2 32/38] crypto: Remove AES_shifts, AES_ishifts, Richard Henderson, 2023/06/08
- [PATCH v2 21/38] target/arm: Use aesdec_IMC, Richard Henderson, 2023/06/08
- [PATCH v2 24/38] target/i386: Use aesenc_SB_SR_MC_AK, Richard Henderson, 2023/06/08
- [PATCH v2 28/38] target/i386: Use aesdec_ISB_ISR_IMC_AK, Richard Henderson, 2023/06/08
- [PATCH v2 22/38] target/riscv: Use aesdec_IMC, Richard Henderson, 2023/06/08
- [PATCH v2 23/38] crypto: Add aesenc_SB_SR_MC_AK, Richard Henderson, 2023/06/08
- [PATCH v2 25/38] target/ppc: Use aesenc_SB_SR_MC_AK,
Richard Henderson <=
- [PATCH v2 29/38] target/riscv: Use aesdec_ISB_ISR_IMC_AK, Richard Henderson, 2023/06/08
- [PATCH v2 30/38] crypto: Add aesdec_ISB_ISR_AK_IMC, Richard Henderson, 2023/06/08
- [PATCH v2 34/38] crypto: Remove AES_imc, Richard Henderson, 2023/06/08
- [PATCH v2 38/38] host/include/ppc: Implement aes-round.h, Richard Henderson, 2023/06/08
- [PATCH v2 37/38] host/include/aarch64: Implement aes-round.h, Richard Henderson, 2023/06/08
- [PATCH v2 35/38] crypto: Unexport AES_*_rot, AES_TeN, AES_TdN, Richard Henderson, 2023/06/08