From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlJ2u-0007B9-6V for qemu-devel@nongnu.org; Mon, 03 Nov 2014 09:55:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlJ2o-0007Z5-Km for qemu-devel@nongnu.org; Mon, 03 Nov 2014 09:55:52 -0500 Message-ID: <54579771.7000305@suse.de> Date: Mon, 03 Nov 2014 15:55:45 +0100 From: Alexander Graf MIME-Version: 1.0 References: <1414427152-8715-1-git-send-email-aurelien@aurel32.net> In-Reply-To: <1414427152-8715-1-git-send-email-aurelien@aurel32.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] target-ppc: simplify AES emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno , qemu-ppc@nongnu.org Cc: Paolo Bonzini , qemu-devel On 27.10.14 17:25, Aurelien Jarno wrote: > This patch simplifies the AES code, by directly accessing the newly added > S-Box, InvS-Box tables instead of recreating them by using the AES_Te and > AES_Td tables. > > Cc: Alexander Graf > Cc: Paolo Bonzini > Signed-off-by: Aurelien Jarno Thanks, applied to ppc-next. It's great to see you back Aurelien! Alex PS: Please CC qemu-devel on patches, so that non-ppc interested people have the chance to review as well ;). > --- > target-ppc/int_helper.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > Note: This has been requested by Paolo Bonzini, but I have no way to > test it, so it is only compile tested. > > diff --git a/target-ppc/int_helper.c b/target-ppc/int_helper.c > index 713d777..e67a5ee 100644 > --- a/target-ppc/int_helper.c > +++ b/target-ppc/int_helper.c > @@ -2352,7 +2352,7 @@ void helper_vcipherlast(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) > int i; > > VECTOR_FOR_INORDER_I(i, u8) { > - r->AVRB(i) = b->AVRB(i) ^ (AES_Te4[a->AVRB(AES_shifts[i])] & 0xFF); > + r->AVRB(i) = b->AVRB(i) ^ (AES_sbox[a->AVRB(AES_shifts[i])]); > } > } > > @@ -2381,7 +2381,7 @@ void helper_vncipherlast(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) > int i; > > VECTOR_FOR_INORDER_I(i, u8) { > - r->AVRB(i) = b->AVRB(i) ^ (AES_Td4[a->AVRB(AES_ishifts[i])] & 0xFF); > + r->AVRB(i) = b->AVRB(i) ^ (AES_isbox[a->AVRB(AES_ishifts[i])]); > } > } > >