summaryrefslogtreecommitdiff
path: root/nacl/crypto_scalarmult/curve25519/athlon/fromdouble.s
blob: 221ca35f2286952927421dfede25bb3fb7cb072d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
.text
.p2align 5
.globl _crypto_scalarmult_curve25519_athlon_fromdouble
.globl crypto_scalarmult_curve25519_athlon_fromdouble
_crypto_scalarmult_curve25519_athlon_fromdouble:
crypto_scalarmult_curve25519_athlon_fromdouble:
mov %esp,%eax
and $31,%eax
add $192,%eax
sub %eax,%esp
movl %ebp,0(%esp)
movl 8(%esp,%eax),%ecx
fldl 0(%ecx)
faddl crypto_scalarmult_curve25519_athlon_out0offset
fstpl 96(%esp)
fldl 8(%ecx)
faddl crypto_scalarmult_curve25519_athlon_out1offset
fstpl 104(%esp)
fldl 16(%ecx)
faddl crypto_scalarmult_curve25519_athlon_out2offset
fstpl 112(%esp)
fldl 24(%ecx)
faddl crypto_scalarmult_curve25519_athlon_out3offset
fstpl 120(%esp)
fldl 32(%ecx)
faddl crypto_scalarmult_curve25519_athlon_out4offset
fstpl 128(%esp)
fldl 40(%ecx)
faddl crypto_scalarmult_curve25519_athlon_out5offset
fstpl 136(%esp)
fldl 48(%ecx)
faddl crypto_scalarmult_curve25519_athlon_out6offset
fstpl 144(%esp)
fldl 56(%ecx)
faddl crypto_scalarmult_curve25519_athlon_out7offset
fstpl 152(%esp)
fldl 64(%ecx)
faddl crypto_scalarmult_curve25519_athlon_out8offset
fstpl 160(%esp)
fldl 72(%ecx)
faddl crypto_scalarmult_curve25519_athlon_out9offset
fstpl 168(%esp)
movl 96(%esp),%ecx
movl %ecx,4(%esp)
movl 104(%esp),%ecx
shl  $26,%ecx
movl %ecx,40(%esp)
movl 104(%esp),%ecx
shr  $6,%ecx
movl %ecx,8(%esp)
movl 112(%esp),%ecx
shl  $19,%ecx
movl %ecx,44(%esp)
movl 112(%esp),%ecx
shr  $13,%ecx
movl %ecx,12(%esp)
movl 120(%esp),%ecx
shl  $13,%ecx
movl %ecx,48(%esp)
movl 120(%esp),%ecx
shr  $19,%ecx
movl %ecx,16(%esp)
movl 128(%esp),%ecx
shl  $6,%ecx
movl %ecx,52(%esp)
movl 128(%esp),%ecx
shr  $26,%ecx
movl 136(%esp),%edx
add  %edx,%ecx
movl %ecx,20(%esp)
movl 144(%esp),%ecx
shl  $25,%ecx
movl %ecx,56(%esp)
movl 144(%esp),%ecx
shr  $7,%ecx
movl %ecx,24(%esp)
movl 152(%esp),%ecx
shl  $19,%ecx
movl %ecx,60(%esp)
movl 152(%esp),%ecx
shr  $13,%ecx
movl %ecx,28(%esp)
movl 160(%esp),%ecx
shl  $12,%ecx
movl %ecx,64(%esp)
movl 160(%esp),%ecx
shr  $20,%ecx
movl %ecx,32(%esp)
movl 168(%esp),%ecx
shl  $6,%ecx
movl %ecx,68(%esp)
movl 168(%esp),%ecx
shr  $26,%ecx
movl %ecx,36(%esp)
mov  $0,%ecx
movl %ecx,72(%esp)
movl 4(%esp),%ecx
addl 40(%esp),%ecx
movl %ecx,4(%esp)
movl 8(%esp),%ecx
adcl 44(%esp),%ecx
movl %ecx,8(%esp)
movl 12(%esp),%ecx
adcl 48(%esp),%ecx
movl %ecx,12(%esp)
movl 16(%esp),%ecx
adcl 52(%esp),%ecx
movl %ecx,16(%esp)
movl 20(%esp),%ecx
adcl 56(%esp),%ecx
movl %ecx,20(%esp)
movl 24(%esp),%ecx
adcl 60(%esp),%ecx
movl %ecx,24(%esp)
movl 28(%esp),%ecx
adcl 64(%esp),%ecx
movl %ecx,28(%esp)
movl 32(%esp),%ecx
adcl 68(%esp),%ecx
movl %ecx,32(%esp)
movl 36(%esp),%ecx
adcl 72(%esp),%ecx
movl %ecx,36(%esp)
movl 4(%esp),%ecx
adc  $0x13,%ecx
movl %ecx,40(%esp)
movl 8(%esp),%ecx
adc  $0,%ecx
movl %ecx,44(%esp)
movl 12(%esp),%ecx
adc  $0,%ecx
movl %ecx,48(%esp)
movl 16(%esp),%ecx
adc  $0,%ecx
movl %ecx,52(%esp)
movl 20(%esp),%ecx
adc  $0,%ecx
movl %ecx,56(%esp)
movl 24(%esp),%ecx
adc  $0,%ecx
movl %ecx,60(%esp)
movl 28(%esp),%ecx
adc  $0,%ecx
movl %ecx,64(%esp)
movl 32(%esp),%ecx
adc  $0x80000000,%ecx
movl %ecx,68(%esp)
movl 36(%esp),%ebp
adc  $0xffffffff,%ebp
and  $0x80000000,%ebp
sar  $31,%ebp
movl 4(%esp,%eax),%ecx
movl 4(%esp),%edx
xorl 40(%esp),%edx
and  %ebp,%edx
xorl 40(%esp),%edx
movl %edx,0(%ecx)
movl 8(%esp),%edx
xorl 44(%esp),%edx
and  %ebp,%edx
xorl 44(%esp),%edx
movl %edx,4(%ecx)
movl 12(%esp),%edx
xorl 48(%esp),%edx
and  %ebp,%edx
xorl 48(%esp),%edx
movl %edx,8(%ecx)
movl 16(%esp),%edx
xorl 52(%esp),%edx
and  %ebp,%edx
xorl 52(%esp),%edx
movl %edx,12(%ecx)
movl 20(%esp),%edx
xorl 56(%esp),%edx
and  %ebp,%edx
xorl 56(%esp),%edx
movl %edx,16(%ecx)
movl 24(%esp),%edx
xorl 60(%esp),%edx
and  %ebp,%edx
xorl 60(%esp),%edx
movl %edx,20(%ecx)
movl 28(%esp),%edx
xorl 64(%esp),%edx
and  %ebp,%edx
xorl 64(%esp),%edx
movl %edx,24(%ecx)
movl 32(%esp),%edx
xorl 68(%esp),%edx
and  %ebp,%edx
xorl 68(%esp),%edx
movl %edx,28(%ecx)
movl 0(%esp),%ebp
add %eax,%esp
ret