From 5e21039a8fadaa06e8bf4088bc86deb4eeabfd8e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Tue, 14 May 2002 19:19:26 +0200
Subject: [PATCH] * x86/aes-encrypt.asm (aes_encrypt): Use the AES_LAST_ROUND
 macro for the first column of the final round. (aes_encrypt): Similarly for
 the second column. (aes_encrypt): Similarly for the third and fourth column.

Rev: src/nettle/ChangeLog:1.88
Rev: src/nettle/x86/aes-encrypt.asm:1.5
---
 ChangeLog           |  2 ++
 x86/aes-encrypt.asm | 31 +++++--------------------------
 2 files changed, 7 insertions(+), 26 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c60fac41..1584f9fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
 
 	* x86/aes-encrypt.asm (aes_encrypt): Use the AES_LAST_ROUND macro
 	for the first column of the final round.
+	(aes_encrypt): Similarly for the second column.
+	(aes_encrypt): Similarly for the third and fourth column.
 
 	* x86/machine.m4 (AES_LAST_ROUND): New macro.
 
diff --git a/x86/aes-encrypt.asm b/x86/aes-encrypt.asm
index e5dbf6b7..fddf0a16 100644
--- a/x86/aes-encrypt.asm
+++ b/x86/aes-encrypt.asm
@@ -190,35 +190,14 @@ C .Laes_got_t:
 	AES_LAST_ROUND(d,a,b,c)
 	pushl	%edi
 
-	C c d a b
-	C // third column
-	movl	%eax,%edi
-	andl	$0x00ff0000,%edi
-	movl	%ebx,%ebp
-	andl	$0xff000000,%ebp
-	orl	%ebp,%edi
-	movl	%ecx,%ebp
-	andl	$0x000000ff,%ebp
-	orl	%ebp,%edi
-	movl	%edx,%ebp
-	andl	$0x0000ff00,%ebp
-	orl	%ebp,%edi
+	C third column
+	AES_LAST_ROUND(c,d,a,b)
 	pushl	%edi
 
-	C // fourth column
-	C b c d a
-	movl	%eax,%edi
-	andl	$0xff000000,%edi
-	movl	%ebx,%ebp
-	andl	$0x000000ff,%ebp
-	orl	%ebp,%edi
-	movl	%ecx,%ebp
-	andl	$0x0000ff00,%ebp
-	orl	%ebp,%edi
-	movl	%edx,%ebp
-	andl	$0x00ff0000,%ebp
-	orl	%ebp,%edi
+	C fourth column
+	AES_LAST_ROUND(b,c,d,a)
 	movl	%edi,%edx
+	
 	popl	%ecx
 	popl	%ebx
 	popl	%eax
-- 
GitLab