Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
33786ac8
Commit
33786ac8
authored
May 15, 2002
by
Niels Möller
Browse files
(aes_decrypt): Use AES_STORE.
Rev: src/nettle/x86/aes-decrypt.asm:1.11
parent
3024714e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/nettle/x86/aes-decrypt.asm
View file @
33786ac8
...
...
@@ -40,9 +40,9 @@ aes_decrypt:
movl
24
(
%
esp
),
%
ebp
testl
%
ebp
,
%
ebp
jz
.L
decrypt_
end
jz
.Lend
.L
decrypt_
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
.L
decrypt
_loop:
.L
round
_loop:
pushl
%
esi
C
save
this
first
:
we
'
ll
cl
obber
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
.L
decrypt
_loop
jnz
.L
round
_loop
C
Foo?
xchgl
%
ebx
,
%
edx
...
...
@@ -109,29 +109,21 @@ aes_decrypt:
C
inverse
S
-
box
substitution
mov
$
4
,
%
edi
.L
i
subst:
.Lsubst:
AES_SUBST_BYTE
(
_aes_decrypt_table
)
decl
%
edi
jnz
.L
i
subst
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
.L
decrypt_
block_loop
jnz
.Lblock_loop
.L
decrypt_
end:
.Lend:
popl
%
edi
popl
%
esi
popl
%
ebp
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment