Skip to content
Snippets Groups Projects
Commit 8bd45c63 authored by Niels Möller's avatar Niels Möller
Browse files

(aes_decrypt): Use AES_LAST_ROUND.

Rev: src/nettle/x86/aes-decrypt.asm:1.8
parent 0610aa4b
No related branches found
No related tags found
No related merge requests found
...@@ -74,7 +74,9 @@ aes_decrypt: ...@@ -74,7 +74,9 @@ aes_decrypt:
popl %ecx popl %ecx
popl %ebx popl %ebx
popl %eax popl %eax
popl %esi popl %esi
xorl (%esi),%eax C add current session key to plaintext xorl (%esi),%eax C add current session key to plaintext
xorl 4(%esi),%ebx xorl 4(%esi),%ebx
xorl 8(%esi),%ecx xorl 8(%esi),%ecx
...@@ -86,65 +88,19 @@ aes_decrypt: ...@@ -86,65 +88,19 @@ aes_decrypt:
C Foo? C Foo?
xchgl %ebx,%edx xchgl %ebx,%edx
C // last round C last round
C // first column
C a b c d AES_LAST_ROUND(a,b,c,d)
movl %eax,%edi
andl $0x000000ff,%edi
movl %ebx,%ebp
andl $0x0000ff00,%ebp
orl %ebp,%edi
movl %ecx,%ebp
andl $0x00ff0000,%ebp
orl %ebp,%edi
movl %edx,%ebp
andl $0xff000000,%ebp
orl %ebp,%edi
pushl %edi pushl %edi
C // second column AES_LAST_ROUND(b,c,d,a)
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
pushl %edi pushl %edi
C // third column AES_LAST_ROUND(c,d,a,b)
C c d a b
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
pushl %edi pushl %edi
C // fourth column AES_LAST_ROUND(d,a,b,c)
C d a b c
movl %eax,%edi
andl $0x0000ff00,%edi
movl %ebx,%ebp
andl $0x00ff0000,%ebp
orl %ebp,%edi
movl %ecx,%ebp
andl $0xff000000,%ebp
orl %ebp,%edi
movl %edx,%ebp
andl $0x000000ff,%ebp
orl %ebp,%edi
movl %edi,%edx movl %edi,%edx
popl %ecx popl %ecx
popl %ebx popl %ebx
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment