[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 18/37] target/ppc: Use aesdec_ISB_ISR_AK_IMC
From: |
Richard Henderson |
Subject: |
[PATCH v4 18/37] target/ppc: Use aesdec_ISB_ISR_AK_IMC |
Date: |
Mon, 3 Jul 2023 12:05:01 +0200 |
This implements the VNCIPHER instruction.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
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 1e477924b7..834da80fe3 100644
--- a/target/ppc/int_helper.c
+++ b/target/ppc/int_helper.c
@@ -2947,22 +2947,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
- Re: [PATCH v4 02/37] tests/multiarch: Add test-aes, (continued)
- [PATCH v4 14/37] host/include/ppc: Implement aes-round.h, Richard Henderson, 2023/07/03
- [PATCH v4 07/37] crypto: Add aesenc_MC, Richard Henderson, 2023/07/03
- [PATCH v4 05/37] crypto: Add aesenc_SB_SR_AK, Richard Henderson, 2023/07/03
- [PATCH v4 21/37] target/i386: Use aesdec_IMC, Richard Henderson, 2023/07/03
- [PATCH v4 22/37] target/i386: Use aesenc_SB_SR_MC_AK, Richard Henderson, 2023/07/03
- [PATCH v4 03/37] target/arm: Move aesmc and aesimc tables to crypto/aes.c, Richard Henderson, 2023/07/03
- [PATCH v4 18/37] target/ppc: Use aesdec_ISB_ISR_AK_IMC,
Richard Henderson <=
- [PATCH v4 11/37] crypto: Add aesdec_ISB_ISR_AK_IMC, Richard Henderson, 2023/07/03
- [PATCH v4 12/37] host/include/i386: Implement aes-round.h, Richard Henderson, 2023/07/03
- [PATCH v4 20/37] target/i386: Use aesdec_ISB_ISR_AK, Richard Henderson, 2023/07/03
- [PATCH v4 24/37] target/arm: Demultiplex AESE and AESMC, Richard Henderson, 2023/07/03
- [PATCH v4 25/37] target/arm: Use aesenc_SB_SR_AK, Richard Henderson, 2023/07/03
- [PATCH v4 26/37] target/arm: Use aesdec_ISB_ISR_AK, Richard Henderson, 2023/07/03
- [PATCH v4 28/37] target/arm: Use aesdec_IMC, Richard Henderson, 2023/07/03