VirtualBox

source: vbox/trunk/src/libs/openssl-3.0.1/crypto/genasm-macosx/rc4-586.S@ 94081

Last change on this file since 94081 was 83531, checked in by vboxsync, 5 years ago

setting svn:sync-process=export for openssl-1.1.1f, all files except tests

File size: 7.0 KB
Line 
1.text
2.globl _RC4
3.align 4
4_RC4:
5L_RC4_begin:
6 pushl %ebp
7 pushl %ebx
8 pushl %esi
9 pushl %edi
10 movl 20(%esp),%edi
11 movl 24(%esp),%edx
12 movl 28(%esp),%esi
13 movl 32(%esp),%ebp
14 xorl %eax,%eax
15 xorl %ebx,%ebx
16 cmpl $0,%edx
17 je L000abort
18 movb (%edi),%al
19 movb 4(%edi),%bl
20 addl $8,%edi
21 leal (%esi,%edx,1),%ecx
22 subl %esi,%ebp
23 movl %ecx,24(%esp)
24 incb %al
25 cmpl $-1,256(%edi)
26 je L001RC4_CHAR
27 movl (%edi,%eax,4),%ecx
28 andl $-4,%edx
29 jz L002loop1
30 movl %ebp,32(%esp)
31 testl $-8,%edx
32 jz L003go4loop4
33 call L004PIC_me_up
34L004PIC_me_up:
35 popl %ebp
36 movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L004PIC_me_up(%ebp),%ebp
37 btl $26,(%ebp)
38 jnc L003go4loop4
39 movl 32(%esp),%ebp
40 andl $-8,%edx
41 leal -8(%esi,%edx,1),%edx
42 movl %edx,-4(%edi)
43 addb %cl,%bl
44 movl (%edi,%ebx,4),%edx
45 movl %ecx,(%edi,%ebx,4)
46 movl %edx,(%edi,%eax,4)
47 incl %eax
48 addl %ecx,%edx
49 movzbl %al,%eax
50 movzbl %dl,%edx
51 movq (%esi),%mm0
52 movl (%edi,%eax,4),%ecx
53 movd (%edi,%edx,4),%mm2
54 jmp L005loop_mmx_enter
55.align 4,0x90
56L006loop_mmx:
57 addb %cl,%bl
58 psllq $56,%mm1
59 movl (%edi,%ebx,4),%edx
60 movl %ecx,(%edi,%ebx,4)
61 movl %edx,(%edi,%eax,4)
62 incl %eax
63 addl %ecx,%edx
64 movzbl %al,%eax
65 movzbl %dl,%edx
66 pxor %mm1,%mm2
67 movq (%esi),%mm0
68 movq %mm2,-8(%ebp,%esi,1)
69 movl (%edi,%eax,4),%ecx
70 movd (%edi,%edx,4),%mm2
71L005loop_mmx_enter:
72 addb %cl,%bl
73 movl (%edi,%ebx,4),%edx
74 movl %ecx,(%edi,%ebx,4)
75 movl %edx,(%edi,%eax,4)
76 incl %eax
77 addl %ecx,%edx
78 movzbl %al,%eax
79 movzbl %dl,%edx
80 pxor %mm0,%mm2
81 movl (%edi,%eax,4),%ecx
82 movd (%edi,%edx,4),%mm1
83 addb %cl,%bl
84 psllq $8,%mm1
85 movl (%edi,%ebx,4),%edx
86 movl %ecx,(%edi,%ebx,4)
87 movl %edx,(%edi,%eax,4)
88 incl %eax
89 addl %ecx,%edx
90 movzbl %al,%eax
91 movzbl %dl,%edx
92 pxor %mm1,%mm2
93 movl (%edi,%eax,4),%ecx
94 movd (%edi,%edx,4),%mm1
95 addb %cl,%bl
96 psllq $16,%mm1
97 movl (%edi,%ebx,4),%edx
98 movl %ecx,(%edi,%ebx,4)
99 movl %edx,(%edi,%eax,4)
100 incl %eax
101 addl %ecx,%edx
102 movzbl %al,%eax
103 movzbl %dl,%edx
104 pxor %mm1,%mm2
105 movl (%edi,%eax,4),%ecx
106 movd (%edi,%edx,4),%mm1
107 addb %cl,%bl
108 psllq $24,%mm1
109 movl (%edi,%ebx,4),%edx
110 movl %ecx,(%edi,%ebx,4)
111 movl %edx,(%edi,%eax,4)
112 incl %eax
113 addl %ecx,%edx
114 movzbl %al,%eax
115 movzbl %dl,%edx
116 pxor %mm1,%mm2
117 movl (%edi,%eax,4),%ecx
118 movd (%edi,%edx,4),%mm1
119 addb %cl,%bl
120 psllq $32,%mm1
121 movl (%edi,%ebx,4),%edx
122 movl %ecx,(%edi,%ebx,4)
123 movl %edx,(%edi,%eax,4)
124 incl %eax
125 addl %ecx,%edx
126 movzbl %al,%eax
127 movzbl %dl,%edx
128 pxor %mm1,%mm2
129 movl (%edi,%eax,4),%ecx
130 movd (%edi,%edx,4),%mm1
131 addb %cl,%bl
132 psllq $40,%mm1
133 movl (%edi,%ebx,4),%edx
134 movl %ecx,(%edi,%ebx,4)
135 movl %edx,(%edi,%eax,4)
136 incl %eax
137 addl %ecx,%edx
138 movzbl %al,%eax
139 movzbl %dl,%edx
140 pxor %mm1,%mm2
141 movl (%edi,%eax,4),%ecx
142 movd (%edi,%edx,4),%mm1
143 addb %cl,%bl
144 psllq $48,%mm1
145 movl (%edi,%ebx,4),%edx
146 movl %ecx,(%edi,%ebx,4)
147 movl %edx,(%edi,%eax,4)
148 incl %eax
149 addl %ecx,%edx
150 movzbl %al,%eax
151 movzbl %dl,%edx
152 pxor %mm1,%mm2
153 movl (%edi,%eax,4),%ecx
154 movd (%edi,%edx,4),%mm1
155 movl %ebx,%edx
156 xorl %ebx,%ebx
157 movb %dl,%bl
158 cmpl -4(%edi),%esi
159 leal 8(%esi),%esi
160 jb L006loop_mmx
161 psllq $56,%mm1
162 pxor %mm1,%mm2
163 movq %mm2,-8(%ebp,%esi,1)
164 emms
165 cmpl 24(%esp),%esi
166 je L007done
167 jmp L002loop1
168.align 4,0x90
169L003go4loop4:
170 leal -4(%esi,%edx,1),%edx
171 movl %edx,28(%esp)
172L008loop4:
173 addb %cl,%bl
174 movl (%edi,%ebx,4),%edx
175 movl %ecx,(%edi,%ebx,4)
176 movl %edx,(%edi,%eax,4)
177 addl %ecx,%edx
178 incb %al
179 andl $255,%edx
180 movl (%edi,%eax,4),%ecx
181 movl (%edi,%edx,4),%ebp
182 addb %cl,%bl
183 movl (%edi,%ebx,4),%edx
184 movl %ecx,(%edi,%ebx,4)
185 movl %edx,(%edi,%eax,4)
186 addl %ecx,%edx
187 incb %al
188 andl $255,%edx
189 rorl $8,%ebp
190 movl (%edi,%eax,4),%ecx
191 orl (%edi,%edx,4),%ebp
192 addb %cl,%bl
193 movl (%edi,%ebx,4),%edx
194 movl %ecx,(%edi,%ebx,4)
195 movl %edx,(%edi,%eax,4)
196 addl %ecx,%edx
197 incb %al
198 andl $255,%edx
199 rorl $8,%ebp
200 movl (%edi,%eax,4),%ecx
201 orl (%edi,%edx,4),%ebp
202 addb %cl,%bl
203 movl (%edi,%ebx,4),%edx
204 movl %ecx,(%edi,%ebx,4)
205 movl %edx,(%edi,%eax,4)
206 addl %ecx,%edx
207 incb %al
208 andl $255,%edx
209 rorl $8,%ebp
210 movl 32(%esp),%ecx
211 orl (%edi,%edx,4),%ebp
212 rorl $8,%ebp
213 xorl (%esi),%ebp
214 cmpl 28(%esp),%esi
215 movl %ebp,(%ecx,%esi,1)
216 leal 4(%esi),%esi
217 movl (%edi,%eax,4),%ecx
218 jb L008loop4
219 cmpl 24(%esp),%esi
220 je L007done
221 movl 32(%esp),%ebp
222.align 4,0x90
223L002loop1:
224 addb %cl,%bl
225 movl (%edi,%ebx,4),%edx
226 movl %ecx,(%edi,%ebx,4)
227 movl %edx,(%edi,%eax,4)
228 addl %ecx,%edx
229 incb %al
230 andl $255,%edx
231 movl (%edi,%edx,4),%edx
232 xorb (%esi),%dl
233 leal 1(%esi),%esi
234 movl (%edi,%eax,4),%ecx
235 cmpl 24(%esp),%esi
236 movb %dl,-1(%ebp,%esi,1)
237 jb L002loop1
238 jmp L007done
239.align 4,0x90
240L001RC4_CHAR:
241 movzbl (%edi,%eax,1),%ecx
242L009cloop1:
243 addb %cl,%bl
244 movzbl (%edi,%ebx,1),%edx
245 movb %cl,(%edi,%ebx,1)
246 movb %dl,(%edi,%eax,1)
247 addb %cl,%dl
248 movzbl (%edi,%edx,1),%edx
249 addb $1,%al
250 xorb (%esi),%dl
251 leal 1(%esi),%esi
252 movzbl (%edi,%eax,1),%ecx
253 cmpl 24(%esp),%esi
254 movb %dl,-1(%ebp,%esi,1)
255 jb L009cloop1
256L007done:
257 decb %al
258 movl %ebx,-4(%edi)
259 movb %al,-8(%edi)
260L000abort:
261 popl %edi
262 popl %esi
263 popl %ebx
264 popl %ebp
265 ret
266.globl _RC4_set_key
267.align 4
268_RC4_set_key:
269L_RC4_set_key_begin:
270 pushl %ebp
271 pushl %ebx
272 pushl %esi
273 pushl %edi
274 movl 20(%esp),%edi
275 movl 24(%esp),%ebp
276 movl 28(%esp),%esi
277 call L010PIC_me_up
278L010PIC_me_up:
279 popl %edx
280 movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L010PIC_me_up(%edx),%edx
281 leal 8(%edi),%edi
282 leal (%esi,%ebp,1),%esi
283 negl %ebp
284 xorl %eax,%eax
285 movl %ebp,-4(%edi)
286 btl $20,(%edx)
287 jc L011c1stloop
288.align 4,0x90
289L012w1stloop:
290 movl %eax,(%edi,%eax,4)
291 addb $1,%al
292 jnc L012w1stloop
293 xorl %ecx,%ecx
294 xorl %edx,%edx
295.align 4,0x90
296L013w2ndloop:
297 movl (%edi,%ecx,4),%eax
298 addb (%esi,%ebp,1),%dl
299 addb %al,%dl
300 addl $1,%ebp
301 movl (%edi,%edx,4),%ebx
302 jnz L014wnowrap
303 movl -4(%edi),%ebp
304L014wnowrap:
305 movl %eax,(%edi,%edx,4)
306 movl %ebx,(%edi,%ecx,4)
307 addb $1,%cl
308 jnc L013w2ndloop
309 jmp L015exit
310.align 4,0x90
311L011c1stloop:
312 movb %al,(%edi,%eax,1)
313 addb $1,%al
314 jnc L011c1stloop
315 xorl %ecx,%ecx
316 xorl %edx,%edx
317 xorl %ebx,%ebx
318.align 4,0x90
319L016c2ndloop:
320 movb (%edi,%ecx,1),%al
321 addb (%esi,%ebp,1),%dl
322 addb %al,%dl
323 addl $1,%ebp
324 movb (%edi,%edx,1),%bl
325 jnz L017cnowrap
326 movl -4(%edi),%ebp
327L017cnowrap:
328 movb %al,(%edi,%edx,1)
329 movb %bl,(%edi,%ecx,1)
330 addb $1,%cl
331 jnc L016c2ndloop
332 movl $-1,256(%edi)
333L015exit:
334 xorl %eax,%eax
335 movl %eax,-8(%edi)
336 movl %eax,-4(%edi)
337 popl %edi
338 popl %esi
339 popl %ebx
340 popl %ebp
341 ret
342.globl _RC4_options
343.align 4
344_RC4_options:
345L_RC4_options_begin:
346 call L018pic_point
347L018pic_point:
348 popl %eax
349 leal L019opts-L018pic_point(%eax),%eax
350 call L020PIC_me_up
351L020PIC_me_up:
352 popl %edx
353 movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L020PIC_me_up(%edx),%edx
354 movl (%edx),%edx
355 btl $20,%edx
356 jc L0211xchar
357 btl $26,%edx
358 jnc L022ret
359 addl $25,%eax
360 ret
361L0211xchar:
362 addl $12,%eax
363L022ret:
364 ret
365.align 6,0x90
366L019opts:
367.byte 114,99,52,40,52,120,44,105,110,116,41,0
368.byte 114,99,52,40,49,120,44,99,104,97,114,41,0
369.byte 114,99,52,40,56,120,44,109,109,120,41,0
370.byte 82,67,52,32,102,111,114,32,120,56,54,44,32,67,82,89
371.byte 80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114
372.byte 111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
373.align 6,0x90
374.section __IMPORT,__pointers,non_lazy_symbol_pointers
375L_OPENSSL_ia32cap_P$non_lazy_ptr:
376.indirect_symbol _OPENSSL_ia32cap_P
377.long 0
378.comm _OPENSSL_ia32cap_P,16,2
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