Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dmitry Baryshkov
nettle
Commits
f2ffb43d
Commit
f2ffb43d
authored
Sep 10, 2008
by
Niels Möller
Browse files
Avoid using registers %rbx and %rbp, which must be preserved.
Rev: nettle/x86_64/sha1-compress.asm:1.2
parent
c52290dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
x86_64/sha1-compress.asm
View file @
f2ffb43d
...
...
@@ -17,16 +17,16 @@ C along with the nettle library; see the file COPYING.LIB. If not, write to
C
the
Free
Software
Foundation
,
Inc.
,
59
Temple
Place
-
Suite
330
,
Boston
,
C
MA
02111
-
1307
,
USA.
C
Register
usage
C
Register
usage
.
KVALUE
and
INPUT
share
a
register.
define
(
<
SA
>
,
<%
eax
>
)
dnl
define
(
<
SB
>
,
<%
ebx
>
)
dnl
define
(
<
SB
>
,
<%
r8d
>
)
dnl
define
(
<
SC
>
,
<%
ecx
>
)
dnl
define
(
<
SD
>
,
<%
edx
>
)
dnl
define
(
<
SE
>
,
<%
ebp
>
)
dnl
define
(
<
SE
>
,
<%
r9d
>
)
dnl
define
(
<
DATA
>
,
<%
rsp
>
)
dnl
define
(
<
TMP
>
,
<%
r
9
d
>
)
dnl
define
(
<
TMP2
>
,
<%
r1
0
d
>
)
dnl
C
Used
by
F3
define
(
<
KVALUE
>
,
<%
r11d
>
)
dnl
define
(
<
TMP
>
,
<%
r
10
d
>
)
dnl
define
(
<
TMP2
>
,
<%
r1
1
d
>
)
dnl
C
Used
by
F3
define
(
<
KVALUE
>
,
<%
esi
>
)
dnl
C
Arguments
define
(
<
STATE
>
,
<%
rdi
>
)
dnl
...
...
@@ -127,17 +127,13 @@ C adding, and then rotating back.
PROLOGUE
(
_nettle_sha1_compress
)
C
save
al
l
registers
that
need
to
be
saved
push
%
rbx
push
%
rbp
sub
$
68
,
%
rsp
C
%
rsp
=
W
C
Load
and
byte
swap
data
SWAP
(
0
,
%
eax
)
SWAP
(
1
,
%
ebx
)
SWAP
(
2
,
%
ecx
)
SWAP
(
3
,
%
edx
)
SWAP
(
4
,
%
eax
)
SWAP
(
5
,
%
ebx
)
SWAP
(
6
,
%
ecx
)
SWAP
(
7
,
%
edx
)
SWAP
(
8
,
%
eax
)
SWAP
(
9
,
%
ebx
)
SWAP
(
10
,
%
ecx
)
SWAP
(
11
,
%
edx
)
SWAP
(
12
,
%
eax
)
SWAP
(
13
,
%
ebx
)
SWAP
(
14
,
%
ecx
)
SWAP
(
15
,
%
edx
)
SWAP
(
0
,
SA
)
SWAP
(
1
,
SB
)
SWAP
(
2
,
SC
)
SWAP
(
3
,
SD
)
SWAP
(
4
,
SA
)
SWAP
(
5
,
SB
)
SWAP
(
6
,
SC
)
SWAP
(
7
,
SD
)
SWAP
(
8
,
SA
)
SWAP
(
9
,
SB
)
SWAP
(
10
,
SC
)
SWAP
(
11
,
SD
)
SWAP
(
12
,
SA
)
SWAP
(
13
,
SB
)
SWAP
(
14
,
SC
)
SWAP
(
15
,
SD
)
C
Load
the
state
vector
movl
(
STATE
),
SA
...
...
@@ -254,7 +250,5 @@ PROLOGUE(_nettle_sha1_compress)
addl
SE
,
16
(
STATE
)
add
$
68
,
%
rsp
pop
%
rbp
pop
%
rbx
ret
EPILOGUE
(
_nettle_sha1_compress
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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