diff options
author | Niels Möller <nisse@lysator.liu.se> | 2002-05-15 12:57:48 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2002-05-15 12:57:48 +0200 |
commit | b7d37c3f7926200cc12f7546d94bc1f6d737bd07 (patch) | |
tree | 7ad67c671cf9375e877ff2958518a6babf36b16a /x86 | |
parent | a7f3f3020e1d396be82d386b49dc9dd57baff208 (diff) | |
download | nettle-b7d37c3f7926200cc12f7546d94bc1f6d737bd07.tar.gz |
(aes_decrypt): Use AES_STORE.
Rev: src/nettle/x86/aes-decrypt.asm:1.11
Diffstat (limited to 'x86')
-rw-r--r-- | x86/aes-decrypt.asm | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/x86/aes-decrypt.asm b/x86/aes-decrypt.asm index 99f78cbf..e19ac708 100644 --- a/x86/aes-decrypt.asm +++ b/x86/aes-decrypt.asm @@ -40,9 +40,9 @@ aes_decrypt: movl 24(%esp), %ebp testl %ebp,%ebp - jz .Ldecrypt_end + jz .Lend -.Ldecrypt_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) @@ -53,7 +53,7 @@ aes_decrypt: subl $1,%ebp C one round is complete addl $16,%esi C point to next key -.Ldecrypt_loop: +.Lround_loop: pushl %esi C save this first: we'll clobber it later C Why??? @@ -83,7 +83,7 @@ aes_decrypt: xorl 12(%esi),%edx addl $16,%esi C point to next key decl %ebp - jnz .Ldecrypt_loop + jnz .Lround_loop C Foo? xchgl %ebx,%edx @@ -109,29 +109,21 @@ aes_decrypt: C inverse S-box substitution mov $4,%edi -.Lisubst: +.Lsubst: AES_SUBST_BYTE(_aes_decrypt_table) decl %edi - jnz .Lisubst + jnz .Lsubst - xorl (%esi),%eax C add last key to plaintext - xorl 4(%esi),%ebx - xorl 8(%esi),%ecx - xorl 12(%esi),%edx - - C // store decrypted data back to caller's buffer + C Add last subkey, and store encrypted data movl 28(%esp),%edi - movl %eax,(%edi) - movl %ebx,4(%edi) - movl %ecx,8(%edi) - movl %edx,12(%edi) + AES_STORE(%esi, %edi) addl $16, 28(%esp) C Increment destination pointer subl $16, 24(%esp) - jnz .Ldecrypt_block_loop + jnz .Lblock_loop -.Ldecrypt_end: +.Lend: popl %edi popl %esi popl %ebp |