Commit 2fd34281 authored by Niels Möller's avatar Niels Möller

Minor cleanups to make the encrypt and decrypt code more similar.

Rev: src/nettle/x86/aes-decrypt.asm:1.12
Rev: src/nettle/x86/aes-encrypt.asm:1.17
parent b7d37c3f
......@@ -120,7 +120,10 @@ aes_decrypt:
AES_STORE(%esi, %edi)
addl $16, 28(%esp) C Increment destination pointer
subl $16, 24(%esp)
subl $16, 24(%esp) C Length
C NOTE: Will loop forever if input data is not an
C integer number of blocks.
jnz .Lblock_loop
.Lend:
......
......@@ -51,9 +51,9 @@ aes_encrypt:
movl 24(%esp), %ebp
testl %ebp,%ebp
jz .Lencrypt_end
jz .Lend
.Lencrypt_block_loop:
.Lblock_loop:
movl 20(%esp),%esi C address of context struct ctx
movl 32(%esp),%ebp C address of plaintext
AES_LOAD(%esi, %ebp)
......@@ -64,7 +64,7 @@ aes_encrypt:
subl $1,%ebp
addl $16,%esi C point to next key
.Laes_encrypt_loop:
.Lround_loop:
pushl %esi C save this first: we'll clobber it later
AES_ROUND(_aes_encrypt_table,a,b,c,d)
......@@ -91,7 +91,7 @@ aes_encrypt:
xorl 12(%esi),%edx
addl $16,%esi C point to next key
decl %ebp
jnz .Laes_encrypt_loop
jnz .Lround_loop
C last round
......@@ -105,15 +105,15 @@ aes_encrypt:
pushl %edi
AES_FINAL_ROUND(d,a,b,c)
movl %edi,%edx
popl %ecx
popl %ebx
popl %eax
C S-box substitution
mov $4,%edi
.Lsubst:
.Lsubst:
AES_SUBST_BYTE(_aes_encrypt_table)
decl %edi
......@@ -128,9 +128,9 @@ aes_encrypt:
C NOTE: Will loop forever if input data is not an
C integer number of blocks.
jnz .Lencrypt_block_loop
jnz .Lblock_loop
.Lencrypt_end:
.Lend:
popl %edi
popl %esi
popl %ebp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment