Message ID | 20230609022401.684157-11-richard.henderson@linaro.org |
---|---|
State | Superseded |
Headers | show |
Series | crypto: Provide aes-round.h and host accel | expand |
On 6/8/23 23:23, Richard Henderson wrote: > This implements the VCIPHERLAST instruction. > > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > --- Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> > 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)
On 9/6/23 04:23, Richard Henderson wrote: > This implements the VCIPHERLAST instruction. > > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > --- > target/ppc/int_helper.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
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)
This implements the VCIPHERLAST instruction. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- target/ppc/int_helper.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)