VirtualBox

source: vbox/trunk/src/libs/openssl-3.1.3/crypto/genasm-macosx/chacha-x86.S@ 101665

Last change on this file since 101665 was 97372, checked in by vboxsync, 2 years ago

libs: Switch to openssl-3.0.7, bugref:10317

File size: 6.7 KB
Line 
1.text
2.globl _ChaCha20_ctr32
3.align 4
4_ChaCha20_ctr32:
5L_ChaCha20_ctr32_begin:
6 #ifdef __CET__
7
8.byte 243,15,30,251
9 #endif
10
11 pushl %ebp
12 pushl %ebx
13 pushl %esi
14 pushl %edi
15 xorl %eax,%eax
16 cmpl 28(%esp),%eax
17 je L000no_data
18 movl 32(%esp),%esi
19 movl 36(%esp),%edi
20 subl $132,%esp
21 movl (%esi),%eax
22 movl 4(%esi),%ebx
23 movl 8(%esi),%ecx
24 movl 12(%esi),%edx
25 movl %eax,80(%esp)
26 movl %ebx,84(%esp)
27 movl %ecx,88(%esp)
28 movl %edx,92(%esp)
29 movl 16(%esi),%eax
30 movl 20(%esi),%ebx
31 movl 24(%esi),%ecx
32 movl 28(%esi),%edx
33 movl %eax,96(%esp)
34 movl %ebx,100(%esp)
35 movl %ecx,104(%esp)
36 movl %edx,108(%esp)
37 movl (%edi),%eax
38 movl 4(%edi),%ebx
39 movl 8(%edi),%ecx
40 movl 12(%edi),%edx
41 subl $1,%eax
42 movl %eax,112(%esp)
43 movl %ebx,116(%esp)
44 movl %ecx,120(%esp)
45 movl %edx,124(%esp)
46 jmp L001entry
47.align 4,0x90
48L002outer_loop:
49 movl %ebx,156(%esp)
50 movl %eax,152(%esp)
51 movl %ecx,160(%esp)
52L001entry:
53 movl $1634760805,%eax
54 movl $857760878,4(%esp)
55 movl $2036477234,8(%esp)
56 movl $1797285236,12(%esp)
57 movl 84(%esp),%ebx
58 movl 88(%esp),%ebp
59 movl 104(%esp),%ecx
60 movl 108(%esp),%esi
61 movl 116(%esp),%edx
62 movl 120(%esp),%edi
63 movl %ebx,20(%esp)
64 movl %ebp,24(%esp)
65 movl %ecx,40(%esp)
66 movl %esi,44(%esp)
67 movl %edx,52(%esp)
68 movl %edi,56(%esp)
69 movl 92(%esp),%ebx
70 movl 124(%esp),%edi
71 movl 112(%esp),%edx
72 movl 80(%esp),%ebp
73 movl 96(%esp),%ecx
74 movl 100(%esp),%esi
75 addl $1,%edx
76 movl %ebx,28(%esp)
77 movl %edi,60(%esp)
78 movl %edx,112(%esp)
79 movl $10,%ebx
80 jmp L003loop
81.align 4,0x90
82L003loop:
83 addl %ebp,%eax
84 movl %ebx,128(%esp)
85 movl %ebp,%ebx
86 xorl %eax,%edx
87 roll $16,%edx
88 addl %edx,%ecx
89 xorl %ecx,%ebx
90 movl 52(%esp),%edi
91 roll $12,%ebx
92 movl 20(%esp),%ebp
93 addl %ebx,%eax
94 xorl %eax,%edx
95 movl %eax,(%esp)
96 roll $8,%edx
97 movl 4(%esp),%eax
98 addl %edx,%ecx
99 movl %edx,48(%esp)
100 xorl %ecx,%ebx
101 addl %ebp,%eax
102 roll $7,%ebx
103 xorl %eax,%edi
104 movl %ecx,32(%esp)
105 roll $16,%edi
106 movl %ebx,16(%esp)
107 addl %edi,%esi
108 movl 40(%esp),%ecx
109 xorl %esi,%ebp
110 movl 56(%esp),%edx
111 roll $12,%ebp
112 movl 24(%esp),%ebx
113 addl %ebp,%eax
114 xorl %eax,%edi
115 movl %eax,4(%esp)
116 roll $8,%edi
117 movl 8(%esp),%eax
118 addl %edi,%esi
119 movl %edi,52(%esp)
120 xorl %esi,%ebp
121 addl %ebx,%eax
122 roll $7,%ebp
123 xorl %eax,%edx
124 movl %esi,36(%esp)
125 roll $16,%edx
126 movl %ebp,20(%esp)
127 addl %edx,%ecx
128 movl 44(%esp),%esi
129 xorl %ecx,%ebx
130 movl 60(%esp),%edi
131 roll $12,%ebx
132 movl 28(%esp),%ebp
133 addl %ebx,%eax
134 xorl %eax,%edx
135 movl %eax,8(%esp)
136 roll $8,%edx
137 movl 12(%esp),%eax
138 addl %edx,%ecx
139 movl %edx,56(%esp)
140 xorl %ecx,%ebx
141 addl %ebp,%eax
142 roll $7,%ebx
143 xorl %eax,%edi
144 roll $16,%edi
145 movl %ebx,24(%esp)
146 addl %edi,%esi
147 xorl %esi,%ebp
148 roll $12,%ebp
149 movl 20(%esp),%ebx
150 addl %ebp,%eax
151 xorl %eax,%edi
152 movl %eax,12(%esp)
153 roll $8,%edi
154 movl (%esp),%eax
155 addl %edi,%esi
156 movl %edi,%edx
157 xorl %esi,%ebp
158 addl %ebx,%eax
159 roll $7,%ebp
160 xorl %eax,%edx
161 roll $16,%edx
162 movl %ebp,28(%esp)
163 addl %edx,%ecx
164 xorl %ecx,%ebx
165 movl 48(%esp),%edi
166 roll $12,%ebx
167 movl 24(%esp),%ebp
168 addl %ebx,%eax
169 xorl %eax,%edx
170 movl %eax,(%esp)
171 roll $8,%edx
172 movl 4(%esp),%eax
173 addl %edx,%ecx
174 movl %edx,60(%esp)
175 xorl %ecx,%ebx
176 addl %ebp,%eax
177 roll $7,%ebx
178 xorl %eax,%edi
179 movl %ecx,40(%esp)
180 roll $16,%edi
181 movl %ebx,20(%esp)
182 addl %edi,%esi
183 movl 32(%esp),%ecx
184 xorl %esi,%ebp
185 movl 52(%esp),%edx
186 roll $12,%ebp
187 movl 28(%esp),%ebx
188 addl %ebp,%eax
189 xorl %eax,%edi
190 movl %eax,4(%esp)
191 roll $8,%edi
192 movl 8(%esp),%eax
193 addl %edi,%esi
194 movl %edi,48(%esp)
195 xorl %esi,%ebp
196 addl %ebx,%eax
197 roll $7,%ebp
198 xorl %eax,%edx
199 movl %esi,44(%esp)
200 roll $16,%edx
201 movl %ebp,24(%esp)
202 addl %edx,%ecx
203 movl 36(%esp),%esi
204 xorl %ecx,%ebx
205 movl 56(%esp),%edi
206 roll $12,%ebx
207 movl 16(%esp),%ebp
208 addl %ebx,%eax
209 xorl %eax,%edx
210 movl %eax,8(%esp)
211 roll $8,%edx
212 movl 12(%esp),%eax
213 addl %edx,%ecx
214 movl %edx,52(%esp)
215 xorl %ecx,%ebx
216 addl %ebp,%eax
217 roll $7,%ebx
218 xorl %eax,%edi
219 roll $16,%edi
220 movl %ebx,28(%esp)
221 addl %edi,%esi
222 xorl %esi,%ebp
223 movl 48(%esp),%edx
224 roll $12,%ebp
225 movl 128(%esp),%ebx
226 addl %ebp,%eax
227 xorl %eax,%edi
228 movl %eax,12(%esp)
229 roll $8,%edi
230 movl (%esp),%eax
231 addl %edi,%esi
232 movl %edi,56(%esp)
233 xorl %esi,%ebp
234 roll $7,%ebp
235 decl %ebx
236 jnz L003loop
237 movl 160(%esp),%ebx
238 addl $1634760805,%eax
239 addl 80(%esp),%ebp
240 addl 96(%esp),%ecx
241 addl 100(%esp),%esi
242 cmpl $64,%ebx
243 jb L004tail
244 movl 156(%esp),%ebx
245 addl 112(%esp),%edx
246 addl 120(%esp),%edi
247 xorl (%ebx),%eax
248 xorl 16(%ebx),%ebp
249 movl %eax,(%esp)
250 movl 152(%esp),%eax
251 xorl 32(%ebx),%ecx
252 xorl 36(%ebx),%esi
253 xorl 48(%ebx),%edx
254 xorl 56(%ebx),%edi
255 movl %ebp,16(%eax)
256 movl %ecx,32(%eax)
257 movl %esi,36(%eax)
258 movl %edx,48(%eax)
259 movl %edi,56(%eax)
260 movl 4(%esp),%ebp
261 movl 8(%esp),%ecx
262 movl 12(%esp),%esi
263 movl 20(%esp),%edx
264 movl 24(%esp),%edi
265 addl $857760878,%ebp
266 addl $2036477234,%ecx
267 addl $1797285236,%esi
268 addl 84(%esp),%edx
269 addl 88(%esp),%edi
270 xorl 4(%ebx),%ebp
271 xorl 8(%ebx),%ecx
272 xorl 12(%ebx),%esi
273 xorl 20(%ebx),%edx
274 xorl 24(%ebx),%edi
275 movl %ebp,4(%eax)
276 movl %ecx,8(%eax)
277 movl %esi,12(%eax)
278 movl %edx,20(%eax)
279 movl %edi,24(%eax)
280 movl 28(%esp),%ebp
281 movl 40(%esp),%ecx
282 movl 44(%esp),%esi
283 movl 52(%esp),%edx
284 movl 60(%esp),%edi
285 addl 92(%esp),%ebp
286 addl 104(%esp),%ecx
287 addl 108(%esp),%esi
288 addl 116(%esp),%edx
289 addl 124(%esp),%edi
290 xorl 28(%ebx),%ebp
291 xorl 40(%ebx),%ecx
292 xorl 44(%ebx),%esi
293 xorl 52(%ebx),%edx
294 xorl 60(%ebx),%edi
295 leal 64(%ebx),%ebx
296 movl %ebp,28(%eax)
297 movl (%esp),%ebp
298 movl %ecx,40(%eax)
299 movl 160(%esp),%ecx
300 movl %esi,44(%eax)
301 movl %edx,52(%eax)
302 movl %edi,60(%eax)
303 movl %ebp,(%eax)
304 leal 64(%eax),%eax
305 subl $64,%ecx
306 jnz L002outer_loop
307 jmp L005done
308L004tail:
309 addl 112(%esp),%edx
310 addl 120(%esp),%edi
311 movl %eax,(%esp)
312 movl %ebp,16(%esp)
313 movl %ecx,32(%esp)
314 movl %esi,36(%esp)
315 movl %edx,48(%esp)
316 movl %edi,56(%esp)
317 movl 4(%esp),%ebp
318 movl 8(%esp),%ecx
319 movl 12(%esp),%esi
320 movl 20(%esp),%edx
321 movl 24(%esp),%edi
322 addl $857760878,%ebp
323 addl $2036477234,%ecx
324 addl $1797285236,%esi
325 addl 84(%esp),%edx
326 addl 88(%esp),%edi
327 movl %ebp,4(%esp)
328 movl %ecx,8(%esp)
329 movl %esi,12(%esp)
330 movl %edx,20(%esp)
331 movl %edi,24(%esp)
332 movl 28(%esp),%ebp
333 movl 40(%esp),%ecx
334 movl 44(%esp),%esi
335 movl 52(%esp),%edx
336 movl 60(%esp),%edi
337 addl 92(%esp),%ebp
338 addl 104(%esp),%ecx
339 addl 108(%esp),%esi
340 addl 116(%esp),%edx
341 addl 124(%esp),%edi
342 movl %ebp,28(%esp)
343 movl 156(%esp),%ebp
344 movl %ecx,40(%esp)
345 movl 152(%esp),%ecx
346 movl %esi,44(%esp)
347 xorl %esi,%esi
348 movl %edx,52(%esp)
349 movl %edi,60(%esp)
350 xorl %eax,%eax
351 xorl %edx,%edx
352L006tail_loop:
353 movb (%esi,%ebp,1),%al
354 movb (%esp,%esi,1),%dl
355 leal 1(%esi),%esi
356 xorb %dl,%al
357 movb %al,-1(%ecx,%esi,1)
358 decl %ebx
359 jnz L006tail_loop
360L005done:
361 addl $132,%esp
362L000no_data:
363 popl %edi
364 popl %esi
365 popl %ebx
366 popl %ebp
367 ret
368.byte 67,104,97,67,104,97,50,48,32,102,111,114,32,120,56,54
369.byte 44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32
370.byte 60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111
371.byte 114,103,62,0
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette