aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-06-02 14:28:15 -0700
committerRichard Henderson <richard.henderson@linaro.org>2023-07-08 07:30:17 +0100
commitce9f5b371ddd82b51569a2c24216501182caaadf (patch)
tree2a351645e927dd7059314c5c5e4a73d1ce955539
parent2cf44f3b8c5106acf90edd7463b4d0dfd9441697 (diff)
downloadqemu-ce9f5b371ddd82b51569a2c24216501182caaadf.zip
qemu-ce9f5b371ddd82b51569a2c24216501182caaadf.tar.gz
qemu-ce9f5b371ddd82b51569a2c24216501182caaadf.tar.bz2
target/ppc: Use aesenc_SB_SR_MC_AK
This implements the VCIPHER 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>
-rw-r--r--target/ppc/int_helper.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c
index 15f07fc..1e47792 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)