[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 17/37] target/ppc: Use aesenc_SB_SR_MC_AK
From: |
Richard Henderson |
Subject: |
[PATCH v4 17/37] target/ppc: Use aesenc_SB_SR_MC_AK |
Date: |
Mon, 3 Jul 2023 12:05:00 +0200 |
This implements the VCIPHER instruction.
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
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 v4 00/37] crypto: Provide aes-round.h and host accel, Richard Henderson, 2023/07/03
- [PATCH v4 02/37] tests/multiarch: Add test-aes, 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 12/37] host/include/i386: Implement aes-round.h, Richard Henderson, 2023/07/03
- [PATCH v4 01/37] util: Add cpuinfo-ppc.c, Richard Henderson, 2023/07/03
- [PATCH v4 17/37] target/ppc: Use aesenc_SB_SR_MC_AK,
Richard Henderson <=
- [PATCH v4 10/37] crypto: Add aesdec_ISB_ISR_IMC_AK, Richard Henderson, 2023/07/03
- [PATCH v4 04/37] crypto/aes: Add AES_SH, AES_ISH macros, Richard Henderson, 2023/07/03
- [PATCH v4 07/37] crypto: Add aesenc_MC, Richard Henderson, 2023/07/03
- [PATCH v4 14/37] host/include/ppc: Implement aes-round.h, Richard Henderson, 2023/07/03
- [PATCH v4 15/37] target/ppc: Use aesenc_SB_SR_AK, Richard Henderson, 2023/07/03
- [PATCH v4 13/37] host/include/aarch64: Implement aes-round.h, Richard Henderson, 2023/07/03
- [PATCH v4 19/37] target/i386: Use aesenc_SB_SR_AK, Richard Henderson, 2023/07/03
- [PATCH v4 08/37] crypto: Add aesdec_IMC, Richard Henderson, 2023/07/03