Skip to content

Commit

Permalink
target/ppc: Use aesenc_SB_SR_AK
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rth7680 committed Jul 8, 2023
1 parent 5735732 commit 7df34e4
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions target/ppc/int_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 7df34e4

Please sign in to comment.