[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 07/38] target/i386: Use aesenc_SB_SR_AK
From: |
Richard Henderson |
Subject: |
[PATCH v2 07/38] target/i386: Use aesenc_SB_SR_AK |
Date: |
Thu, 8 Jun 2023 19:23:30 -0700 |
This implements the AESENCLAST instruction.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/i386/ops_sse.h | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h
index fb63af7afa..63fdecbe03 100644
--- a/target/i386/ops_sse.h
+++ b/target/i386/ops_sse.h
@@ -19,6 +19,7 @@
*/
#include "crypto/aes.h"
+#include "crypto/aes-round.h"
#if SHIFT == 0
#define Reg MMXReg
@@ -2202,12 +2203,12 @@ void glue(helper_aesenc, SUFFIX)(CPUX86State *env, Reg
*d, Reg *v, Reg *s)
void glue(helper_aesenclast, SUFFIX)(CPUX86State *env, Reg *d, Reg *v, Reg *s)
{
- int i;
- Reg st = *v;
- Reg rk = *s;
+ for (int i = 0; i < SHIFT; i++) {
+ AESState *ad = (AESState *)&d->ZMM_X(i);
+ AESState *st = (AESState *)&v->ZMM_X(i);
+ AESState *rk = (AESState *)&s->ZMM_X(i);
- for (i = 0; i < 8 << SHIFT; i++) {
- d->B(i) = rk.B(i) ^ (AES_sbox[st.B(AES_shifts[i & 15] + (i & ~15))]);
+ aesenc_SB_SR_AK(ad, st, rk, false);
}
}
--
2.34.1
- Re: [PATCH v2 02/38] util: Add cpuinfo-ppc.c, (continued)
- [PATCH v2 01/38] tcg/ppc: Define _CALL_AIX for clang on ppc64(be), Richard Henderson, 2023/06/08
- [PATCH v2 03/38] tests/multiarch: Add test-aes, Richard Henderson, 2023/06/08
- [PATCH v2 04/38] target/arm: Move aesmc and aesimc tables to crypto/aes.c, Richard Henderson, 2023/06/08
- [PATCH v2 07/38] target/i386: Use aesenc_SB_SR_AK,
Richard Henderson <=
- [PATCH v2 10/38] target/ppc: Use aesenc_SB_SR_AK, Richard Henderson, 2023/06/08
- [PATCH v2 05/38] crypto/aes: Add constants for ShiftRows, InvShiftRows, Richard Henderson, 2023/06/08
- [PATCH v2 06/38] crypto: Add aesenc_SB_SR_AK, Richard Henderson, 2023/06/08