[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 09/37] target/ppc: Use aesenc_SB_SR_AK
From: |
Richard Henderson |
Subject: |
[PATCH v3 09/37] target/ppc: Use aesenc_SB_SR_AK |
Date: |
Tue, 20 Jun 2023 13:07:30 +0200 |
This implements the VCIPHERLAST 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 | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c
index d97a7f1f28..34257e9d76 100644
--- a/target/ppc/int_helper.c
+++ b/target/ppc/int_helper.c
@@ -25,6 +25,7 @@
#include "qemu/log.h"
#include "exec/helper-proto.h"
#include "crypto/aes.h"
+#include "crypto/aes-round.h"
#include "fpu/softfloat.h"
#include "qapi/error.h"
#include "qemu/guest-random.h"
@@ -2947,13 +2948,7 @@ void helper_vcipher(ppc_avr_t *r, ppc_avr_t *a,
ppc_avr_t *b)
void helper_vcipherlast(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
{
- ppc_avr_t result;
- int i;
-
- VECTOR_FOR_INORDER_I(i, u8) {
- result.VsrB(i) = b->VsrB(i) ^ (AES_sbox[a->VsrB(AES_shifts[i])]);
- }
- *r = result;
+ aesenc_SB_SR_AK((AESState *)r, (AESState *)a, (AESState *)b, true);
}
void helper_vncipher(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
--
2.34.1
- [PATCH v3 02/37] tests/multiarch: Add test-aes, (continued)
- [PATCH v3 02/37] tests/multiarch: Add test-aes, Richard Henderson, 2023/06/20
- [PATCH v3 03/37] target/arm: Move aesmc and aesimc tables to crypto/aes.c, Richard Henderson, 2023/06/20
- [PATCH v3 04/37] crypto/aes: Add constants for ShiftRows, InvShiftRows, Richard Henderson, 2023/06/20
- [PATCH v3 05/37] crypto: Add aesenc_SB_SR_AK, Richard Henderson, 2023/06/20
- [PATCH v3 07/37] target/arm: Demultiplex AESE and AESMC, Richard Henderson, 2023/06/20
- [PATCH v3 06/37] target/i386: Use aesenc_SB_SR_AK, Richard Henderson, 2023/06/20
- [PATCH v3 08/37] target/arm: Use aesenc_SB_SR_AK, Richard Henderson, 2023/06/20
- [PATCH v3 09/37] target/ppc: Use aesenc_SB_SR_AK,
Richard Henderson <=
- [PATCH v3 10/37] target/riscv: Use aesenc_SB_SR_AK, Richard Henderson, 2023/06/20
- [PATCH v3 11/37] crypto: Add aesdec_ISB_ISR_AK, Richard Henderson, 2023/06/20
- [PATCH v3 12/37] target/i386: Use aesdec_ISB_ISR_AK, Richard Henderson, 2023/06/20
- [PATCH v3 13/37] target/arm: Use aesdec_ISB_ISR_AK, Richard Henderson, 2023/06/20
- [PATCH v3 14/37] target/ppc: Use aesdec_ISB_ISR_AK, Richard Henderson, 2023/06/20
- [PATCH v3 15/37] target/riscv: Use aesdec_ISB_ISR_AK, Richard Henderson, 2023/06/20
- [PATCH v3 16/37] crypto: Add aesenc_MC, Richard Henderson, 2023/06/20
- [PATCH v3 17/37] target/arm: Use aesenc_MC, Richard Henderson, 2023/06/20