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