xref: /freebsd/sys/crypto/openssl/i386/cast-586.S (revision dcc4d2939f789a6d1f272ffeab2068ba2b7525ea)
1/* Do not modify. This file is auto-generated from cast-586.pl. */
2#ifdef PIC
3.text
4.globl	CAST_encrypt
5.type	CAST_encrypt,@function
6.align	16
7CAST_encrypt:
8.L_CAST_encrypt_begin:
9	#ifdef __CET__
10
11.byte	243,15,30,251
12	#endif
13
14
15	pushl	%ebp
16	pushl	%ebx
17	movl	12(%esp),%ebx
18	movl	16(%esp),%ebp
19	pushl	%esi
20	pushl	%edi
21
22	movl	(%ebx),%edi
23	movl	4(%ebx),%esi
24
25	movl	128(%ebp),%eax
26	pushl	%eax
27	xorl	%eax,%eax
28
29	movl	(%ebp),%edx
30	movl	4(%ebp),%ecx
31	addl	%esi,%edx
32	roll	%cl,%edx
33	xorl	%ecx,%ecx
34	movl	$255,%ebx
35	movb	%dh,%cl
36	andl	%edx,%ebx
37	shrl	$16,%edx
38	xorl	%eax,%eax
39	movb	%dh,%al
40	andl	$255,%edx
41	movl	CAST_S_table0(,%ecx,4),%ecx
42	movl	CAST_S_table1(,%ebx,4),%ebx
43	xorl	%ebx,%ecx
44	movl	CAST_S_table2(,%eax,4),%ebx
45	subl	%ebx,%ecx
46	movl	CAST_S_table3(,%edx,4),%ebx
47	addl	%ebx,%ecx
48	xorl	%ecx,%edi
49
50	movl	8(%ebp),%edx
51	movl	12(%ebp),%ecx
52	xorl	%edi,%edx
53	roll	%cl,%edx
54	xorl	%ecx,%ecx
55	movl	$255,%ebx
56	movb	%dh,%cl
57	andl	%edx,%ebx
58	shrl	$16,%edx
59	xorl	%eax,%eax
60	movb	%dh,%al
61	andl	$255,%edx
62	movl	CAST_S_table0(,%ecx,4),%ecx
63	movl	CAST_S_table1(,%ebx,4),%ebx
64	subl	%ebx,%ecx
65	movl	CAST_S_table2(,%eax,4),%ebx
66	addl	%ebx,%ecx
67	movl	CAST_S_table3(,%edx,4),%ebx
68	xorl	%ebx,%ecx
69	xorl	%ecx,%esi
70
71	movl	16(%ebp),%edx
72	movl	20(%ebp),%ecx
73	subl	%esi,%edx
74	roll	%cl,%edx
75	xorl	%ecx,%ecx
76	movl	$255,%ebx
77	movb	%dh,%cl
78	andl	%edx,%ebx
79	shrl	$16,%edx
80	xorl	%eax,%eax
81	movb	%dh,%al
82	andl	$255,%edx
83	movl	CAST_S_table0(,%ecx,4),%ecx
84	movl	CAST_S_table1(,%ebx,4),%ebx
85	addl	%ebx,%ecx
86	movl	CAST_S_table2(,%eax,4),%ebx
87	xorl	%ebx,%ecx
88	movl	CAST_S_table3(,%edx,4),%ebx
89	subl	%ebx,%ecx
90	xorl	%ecx,%edi
91
92	movl	24(%ebp),%edx
93	movl	28(%ebp),%ecx
94	addl	%edi,%edx
95	roll	%cl,%edx
96	xorl	%ecx,%ecx
97	movl	$255,%ebx
98	movb	%dh,%cl
99	andl	%edx,%ebx
100	shrl	$16,%edx
101	xorl	%eax,%eax
102	movb	%dh,%al
103	andl	$255,%edx
104	movl	CAST_S_table0(,%ecx,4),%ecx
105	movl	CAST_S_table1(,%ebx,4),%ebx
106	xorl	%ebx,%ecx
107	movl	CAST_S_table2(,%eax,4),%ebx
108	subl	%ebx,%ecx
109	movl	CAST_S_table3(,%edx,4),%ebx
110	addl	%ebx,%ecx
111	xorl	%ecx,%esi
112
113	movl	32(%ebp),%edx
114	movl	36(%ebp),%ecx
115	xorl	%esi,%edx
116	roll	%cl,%edx
117	xorl	%ecx,%ecx
118	movl	$255,%ebx
119	movb	%dh,%cl
120	andl	%edx,%ebx
121	shrl	$16,%edx
122	xorl	%eax,%eax
123	movb	%dh,%al
124	andl	$255,%edx
125	movl	CAST_S_table0(,%ecx,4),%ecx
126	movl	CAST_S_table1(,%ebx,4),%ebx
127	subl	%ebx,%ecx
128	movl	CAST_S_table2(,%eax,4),%ebx
129	addl	%ebx,%ecx
130	movl	CAST_S_table3(,%edx,4),%ebx
131	xorl	%ebx,%ecx
132	xorl	%ecx,%edi
133
134	movl	40(%ebp),%edx
135	movl	44(%ebp),%ecx
136	subl	%edi,%edx
137	roll	%cl,%edx
138	xorl	%ecx,%ecx
139	movl	$255,%ebx
140	movb	%dh,%cl
141	andl	%edx,%ebx
142	shrl	$16,%edx
143	xorl	%eax,%eax
144	movb	%dh,%al
145	andl	$255,%edx
146	movl	CAST_S_table0(,%ecx,4),%ecx
147	movl	CAST_S_table1(,%ebx,4),%ebx
148	addl	%ebx,%ecx
149	movl	CAST_S_table2(,%eax,4),%ebx
150	xorl	%ebx,%ecx
151	movl	CAST_S_table3(,%edx,4),%ebx
152	subl	%ebx,%ecx
153	xorl	%ecx,%esi
154
155	movl	48(%ebp),%edx
156	movl	52(%ebp),%ecx
157	addl	%esi,%edx
158	roll	%cl,%edx
159	xorl	%ecx,%ecx
160	movl	$255,%ebx
161	movb	%dh,%cl
162	andl	%edx,%ebx
163	shrl	$16,%edx
164	xorl	%eax,%eax
165	movb	%dh,%al
166	andl	$255,%edx
167	movl	CAST_S_table0(,%ecx,4),%ecx
168	movl	CAST_S_table1(,%ebx,4),%ebx
169	xorl	%ebx,%ecx
170	movl	CAST_S_table2(,%eax,4),%ebx
171	subl	%ebx,%ecx
172	movl	CAST_S_table3(,%edx,4),%ebx
173	addl	%ebx,%ecx
174	xorl	%ecx,%edi
175
176	movl	56(%ebp),%edx
177	movl	60(%ebp),%ecx
178	xorl	%edi,%edx
179	roll	%cl,%edx
180	xorl	%ecx,%ecx
181	movl	$255,%ebx
182	movb	%dh,%cl
183	andl	%edx,%ebx
184	shrl	$16,%edx
185	xorl	%eax,%eax
186	movb	%dh,%al
187	andl	$255,%edx
188	movl	CAST_S_table0(,%ecx,4),%ecx
189	movl	CAST_S_table1(,%ebx,4),%ebx
190	subl	%ebx,%ecx
191	movl	CAST_S_table2(,%eax,4),%ebx
192	addl	%ebx,%ecx
193	movl	CAST_S_table3(,%edx,4),%ebx
194	xorl	%ebx,%ecx
195	xorl	%ecx,%esi
196
197	movl	64(%ebp),%edx
198	movl	68(%ebp),%ecx
199	subl	%esi,%edx
200	roll	%cl,%edx
201	xorl	%ecx,%ecx
202	movl	$255,%ebx
203	movb	%dh,%cl
204	andl	%edx,%ebx
205	shrl	$16,%edx
206	xorl	%eax,%eax
207	movb	%dh,%al
208	andl	$255,%edx
209	movl	CAST_S_table0(,%ecx,4),%ecx
210	movl	CAST_S_table1(,%ebx,4),%ebx
211	addl	%ebx,%ecx
212	movl	CAST_S_table2(,%eax,4),%ebx
213	xorl	%ebx,%ecx
214	movl	CAST_S_table3(,%edx,4),%ebx
215	subl	%ebx,%ecx
216	xorl	%ecx,%edi
217
218	movl	72(%ebp),%edx
219	movl	76(%ebp),%ecx
220	addl	%edi,%edx
221	roll	%cl,%edx
222	xorl	%ecx,%ecx
223	movl	$255,%ebx
224	movb	%dh,%cl
225	andl	%edx,%ebx
226	shrl	$16,%edx
227	xorl	%eax,%eax
228	movb	%dh,%al
229	andl	$255,%edx
230	movl	CAST_S_table0(,%ecx,4),%ecx
231	movl	CAST_S_table1(,%ebx,4),%ebx
232	xorl	%ebx,%ecx
233	movl	CAST_S_table2(,%eax,4),%ebx
234	subl	%ebx,%ecx
235	movl	CAST_S_table3(,%edx,4),%ebx
236	addl	%ebx,%ecx
237	xorl	%ecx,%esi
238
239	movl	80(%ebp),%edx
240	movl	84(%ebp),%ecx
241	xorl	%esi,%edx
242	roll	%cl,%edx
243	xorl	%ecx,%ecx
244	movl	$255,%ebx
245	movb	%dh,%cl
246	andl	%edx,%ebx
247	shrl	$16,%edx
248	xorl	%eax,%eax
249	movb	%dh,%al
250	andl	$255,%edx
251	movl	CAST_S_table0(,%ecx,4),%ecx
252	movl	CAST_S_table1(,%ebx,4),%ebx
253	subl	%ebx,%ecx
254	movl	CAST_S_table2(,%eax,4),%ebx
255	addl	%ebx,%ecx
256	movl	CAST_S_table3(,%edx,4),%ebx
257	xorl	%ebx,%ecx
258	xorl	%ecx,%edi
259
260	movl	88(%ebp),%edx
261	movl	92(%ebp),%ecx
262	subl	%edi,%edx
263	roll	%cl,%edx
264	xorl	%ecx,%ecx
265	movl	$255,%ebx
266	movb	%dh,%cl
267	andl	%edx,%ebx
268	shrl	$16,%edx
269	xorl	%eax,%eax
270	movb	%dh,%al
271	andl	$255,%edx
272	movl	CAST_S_table0(,%ecx,4),%ecx
273	movl	CAST_S_table1(,%ebx,4),%ebx
274	addl	%ebx,%ecx
275	movl	CAST_S_table2(,%eax,4),%ebx
276	xorl	%ebx,%ecx
277	movl	CAST_S_table3(,%edx,4),%ebx
278	subl	%ebx,%ecx
279	xorl	%ecx,%esi
280
281	popl	%edx
282	orl	%edx,%edx
283	jnz	.L000cast_enc_done
284
285	movl	96(%ebp),%edx
286	movl	100(%ebp),%ecx
287	addl	%esi,%edx
288	roll	%cl,%edx
289	xorl	%ecx,%ecx
290	movl	$255,%ebx
291	movb	%dh,%cl
292	andl	%edx,%ebx
293	shrl	$16,%edx
294	xorl	%eax,%eax
295	movb	%dh,%al
296	andl	$255,%edx
297	movl	CAST_S_table0(,%ecx,4),%ecx
298	movl	CAST_S_table1(,%ebx,4),%ebx
299	xorl	%ebx,%ecx
300	movl	CAST_S_table2(,%eax,4),%ebx
301	subl	%ebx,%ecx
302	movl	CAST_S_table3(,%edx,4),%ebx
303	addl	%ebx,%ecx
304	xorl	%ecx,%edi
305
306	movl	104(%ebp),%edx
307	movl	108(%ebp),%ecx
308	xorl	%edi,%edx
309	roll	%cl,%edx
310	xorl	%ecx,%ecx
311	movl	$255,%ebx
312	movb	%dh,%cl
313	andl	%edx,%ebx
314	shrl	$16,%edx
315	xorl	%eax,%eax
316	movb	%dh,%al
317	andl	$255,%edx
318	movl	CAST_S_table0(,%ecx,4),%ecx
319	movl	CAST_S_table1(,%ebx,4),%ebx
320	subl	%ebx,%ecx
321	movl	CAST_S_table2(,%eax,4),%ebx
322	addl	%ebx,%ecx
323	movl	CAST_S_table3(,%edx,4),%ebx
324	xorl	%ebx,%ecx
325	xorl	%ecx,%esi
326
327	movl	112(%ebp),%edx
328	movl	116(%ebp),%ecx
329	subl	%esi,%edx
330	roll	%cl,%edx
331	xorl	%ecx,%ecx
332	movl	$255,%ebx
333	movb	%dh,%cl
334	andl	%edx,%ebx
335	shrl	$16,%edx
336	xorl	%eax,%eax
337	movb	%dh,%al
338	andl	$255,%edx
339	movl	CAST_S_table0(,%ecx,4),%ecx
340	movl	CAST_S_table1(,%ebx,4),%ebx
341	addl	%ebx,%ecx
342	movl	CAST_S_table2(,%eax,4),%ebx
343	xorl	%ebx,%ecx
344	movl	CAST_S_table3(,%edx,4),%ebx
345	subl	%ebx,%ecx
346	xorl	%ecx,%edi
347
348	movl	120(%ebp),%edx
349	movl	124(%ebp),%ecx
350	addl	%edi,%edx
351	roll	%cl,%edx
352	xorl	%ecx,%ecx
353	movl	$255,%ebx
354	movb	%dh,%cl
355	andl	%edx,%ebx
356	shrl	$16,%edx
357	xorl	%eax,%eax
358	movb	%dh,%al
359	andl	$255,%edx
360	movl	CAST_S_table0(,%ecx,4),%ecx
361	movl	CAST_S_table1(,%ebx,4),%ebx
362	xorl	%ebx,%ecx
363	movl	CAST_S_table2(,%eax,4),%ebx
364	subl	%ebx,%ecx
365	movl	CAST_S_table3(,%edx,4),%ebx
366	addl	%ebx,%ecx
367	xorl	%ecx,%esi
368.L000cast_enc_done:
369	nop
370	movl	20(%esp),%eax
371	movl	%edi,4(%eax)
372	movl	%esi,(%eax)
373	popl	%edi
374	popl	%esi
375	popl	%ebx
376	popl	%ebp
377	ret
378.size	CAST_encrypt,.-.L_CAST_encrypt_begin
379.globl	CAST_decrypt
380.type	CAST_decrypt,@function
381.align	16
382CAST_decrypt:
383.L_CAST_decrypt_begin:
384	#ifdef __CET__
385
386.byte	243,15,30,251
387	#endif
388
389
390	pushl	%ebp
391	pushl	%ebx
392	movl	12(%esp),%ebx
393	movl	16(%esp),%ebp
394	pushl	%esi
395	pushl	%edi
396
397	movl	(%ebx),%edi
398	movl	4(%ebx),%esi
399
400	movl	128(%ebp),%eax
401	orl	%eax,%eax
402	jnz	.L001cast_dec_skip
403	xorl	%eax,%eax
404
405	movl	120(%ebp),%edx
406	movl	124(%ebp),%ecx
407	addl	%esi,%edx
408	roll	%cl,%edx
409	xorl	%ecx,%ecx
410	movl	$255,%ebx
411	movb	%dh,%cl
412	andl	%edx,%ebx
413	shrl	$16,%edx
414	xorl	%eax,%eax
415	movb	%dh,%al
416	andl	$255,%edx
417	movl	CAST_S_table0(,%ecx,4),%ecx
418	movl	CAST_S_table1(,%ebx,4),%ebx
419	xorl	%ebx,%ecx
420	movl	CAST_S_table2(,%eax,4),%ebx
421	subl	%ebx,%ecx
422	movl	CAST_S_table3(,%edx,4),%ebx
423	addl	%ebx,%ecx
424	xorl	%ecx,%edi
425
426	movl	112(%ebp),%edx
427	movl	116(%ebp),%ecx
428	subl	%edi,%edx
429	roll	%cl,%edx
430	xorl	%ecx,%ecx
431	movl	$255,%ebx
432	movb	%dh,%cl
433	andl	%edx,%ebx
434	shrl	$16,%edx
435	xorl	%eax,%eax
436	movb	%dh,%al
437	andl	$255,%edx
438	movl	CAST_S_table0(,%ecx,4),%ecx
439	movl	CAST_S_table1(,%ebx,4),%ebx
440	addl	%ebx,%ecx
441	movl	CAST_S_table2(,%eax,4),%ebx
442	xorl	%ebx,%ecx
443	movl	CAST_S_table3(,%edx,4),%ebx
444	subl	%ebx,%ecx
445	xorl	%ecx,%esi
446
447	movl	104(%ebp),%edx
448	movl	108(%ebp),%ecx
449	xorl	%esi,%edx
450	roll	%cl,%edx
451	xorl	%ecx,%ecx
452	movl	$255,%ebx
453	movb	%dh,%cl
454	andl	%edx,%ebx
455	shrl	$16,%edx
456	xorl	%eax,%eax
457	movb	%dh,%al
458	andl	$255,%edx
459	movl	CAST_S_table0(,%ecx,4),%ecx
460	movl	CAST_S_table1(,%ebx,4),%ebx
461	subl	%ebx,%ecx
462	movl	CAST_S_table2(,%eax,4),%ebx
463	addl	%ebx,%ecx
464	movl	CAST_S_table3(,%edx,4),%ebx
465	xorl	%ebx,%ecx
466	xorl	%ecx,%edi
467
468	movl	96(%ebp),%edx
469	movl	100(%ebp),%ecx
470	addl	%edi,%edx
471	roll	%cl,%edx
472	xorl	%ecx,%ecx
473	movl	$255,%ebx
474	movb	%dh,%cl
475	andl	%edx,%ebx
476	shrl	$16,%edx
477	xorl	%eax,%eax
478	movb	%dh,%al
479	andl	$255,%edx
480	movl	CAST_S_table0(,%ecx,4),%ecx
481	movl	CAST_S_table1(,%ebx,4),%ebx
482	xorl	%ebx,%ecx
483	movl	CAST_S_table2(,%eax,4),%ebx
484	subl	%ebx,%ecx
485	movl	CAST_S_table3(,%edx,4),%ebx
486	addl	%ebx,%ecx
487	xorl	%ecx,%esi
488.L001cast_dec_skip:
489
490	movl	88(%ebp),%edx
491	movl	92(%ebp),%ecx
492	subl	%esi,%edx
493	roll	%cl,%edx
494	xorl	%ecx,%ecx
495	movl	$255,%ebx
496	movb	%dh,%cl
497	andl	%edx,%ebx
498	shrl	$16,%edx
499	xorl	%eax,%eax
500	movb	%dh,%al
501	andl	$255,%edx
502	movl	CAST_S_table0(,%ecx,4),%ecx
503	movl	CAST_S_table1(,%ebx,4),%ebx
504	addl	%ebx,%ecx
505	movl	CAST_S_table2(,%eax,4),%ebx
506	xorl	%ebx,%ecx
507	movl	CAST_S_table3(,%edx,4),%ebx
508	subl	%ebx,%ecx
509	xorl	%ecx,%edi
510
511	movl	80(%ebp),%edx
512	movl	84(%ebp),%ecx
513	xorl	%edi,%edx
514	roll	%cl,%edx
515	xorl	%ecx,%ecx
516	movl	$255,%ebx
517	movb	%dh,%cl
518	andl	%edx,%ebx
519	shrl	$16,%edx
520	xorl	%eax,%eax
521	movb	%dh,%al
522	andl	$255,%edx
523	movl	CAST_S_table0(,%ecx,4),%ecx
524	movl	CAST_S_table1(,%ebx,4),%ebx
525	subl	%ebx,%ecx
526	movl	CAST_S_table2(,%eax,4),%ebx
527	addl	%ebx,%ecx
528	movl	CAST_S_table3(,%edx,4),%ebx
529	xorl	%ebx,%ecx
530	xorl	%ecx,%esi
531
532	movl	72(%ebp),%edx
533	movl	76(%ebp),%ecx
534	addl	%esi,%edx
535	roll	%cl,%edx
536	xorl	%ecx,%ecx
537	movl	$255,%ebx
538	movb	%dh,%cl
539	andl	%edx,%ebx
540	shrl	$16,%edx
541	xorl	%eax,%eax
542	movb	%dh,%al
543	andl	$255,%edx
544	movl	CAST_S_table0(,%ecx,4),%ecx
545	movl	CAST_S_table1(,%ebx,4),%ebx
546	xorl	%ebx,%ecx
547	movl	CAST_S_table2(,%eax,4),%ebx
548	subl	%ebx,%ecx
549	movl	CAST_S_table3(,%edx,4),%ebx
550	addl	%ebx,%ecx
551	xorl	%ecx,%edi
552
553	movl	64(%ebp),%edx
554	movl	68(%ebp),%ecx
555	subl	%edi,%edx
556	roll	%cl,%edx
557	xorl	%ecx,%ecx
558	movl	$255,%ebx
559	movb	%dh,%cl
560	andl	%edx,%ebx
561	shrl	$16,%edx
562	xorl	%eax,%eax
563	movb	%dh,%al
564	andl	$255,%edx
565	movl	CAST_S_table0(,%ecx,4),%ecx
566	movl	CAST_S_table1(,%ebx,4),%ebx
567	addl	%ebx,%ecx
568	movl	CAST_S_table2(,%eax,4),%ebx
569	xorl	%ebx,%ecx
570	movl	CAST_S_table3(,%edx,4),%ebx
571	subl	%ebx,%ecx
572	xorl	%ecx,%esi
573
574	movl	56(%ebp),%edx
575	movl	60(%ebp),%ecx
576	xorl	%esi,%edx
577	roll	%cl,%edx
578	xorl	%ecx,%ecx
579	movl	$255,%ebx
580	movb	%dh,%cl
581	andl	%edx,%ebx
582	shrl	$16,%edx
583	xorl	%eax,%eax
584	movb	%dh,%al
585	andl	$255,%edx
586	movl	CAST_S_table0(,%ecx,4),%ecx
587	movl	CAST_S_table1(,%ebx,4),%ebx
588	subl	%ebx,%ecx
589	movl	CAST_S_table2(,%eax,4),%ebx
590	addl	%ebx,%ecx
591	movl	CAST_S_table3(,%edx,4),%ebx
592	xorl	%ebx,%ecx
593	xorl	%ecx,%edi
594
595	movl	48(%ebp),%edx
596	movl	52(%ebp),%ecx
597	addl	%edi,%edx
598	roll	%cl,%edx
599	xorl	%ecx,%ecx
600	movl	$255,%ebx
601	movb	%dh,%cl
602	andl	%edx,%ebx
603	shrl	$16,%edx
604	xorl	%eax,%eax
605	movb	%dh,%al
606	andl	$255,%edx
607	movl	CAST_S_table0(,%ecx,4),%ecx
608	movl	CAST_S_table1(,%ebx,4),%ebx
609	xorl	%ebx,%ecx
610	movl	CAST_S_table2(,%eax,4),%ebx
611	subl	%ebx,%ecx
612	movl	CAST_S_table3(,%edx,4),%ebx
613	addl	%ebx,%ecx
614	xorl	%ecx,%esi
615
616	movl	40(%ebp),%edx
617	movl	44(%ebp),%ecx
618	subl	%esi,%edx
619	roll	%cl,%edx
620	xorl	%ecx,%ecx
621	movl	$255,%ebx
622	movb	%dh,%cl
623	andl	%edx,%ebx
624	shrl	$16,%edx
625	xorl	%eax,%eax
626	movb	%dh,%al
627	andl	$255,%edx
628	movl	CAST_S_table0(,%ecx,4),%ecx
629	movl	CAST_S_table1(,%ebx,4),%ebx
630	addl	%ebx,%ecx
631	movl	CAST_S_table2(,%eax,4),%ebx
632	xorl	%ebx,%ecx
633	movl	CAST_S_table3(,%edx,4),%ebx
634	subl	%ebx,%ecx
635	xorl	%ecx,%edi
636
637	movl	32(%ebp),%edx
638	movl	36(%ebp),%ecx
639	xorl	%edi,%edx
640	roll	%cl,%edx
641	xorl	%ecx,%ecx
642	movl	$255,%ebx
643	movb	%dh,%cl
644	andl	%edx,%ebx
645	shrl	$16,%edx
646	xorl	%eax,%eax
647	movb	%dh,%al
648	andl	$255,%edx
649	movl	CAST_S_table0(,%ecx,4),%ecx
650	movl	CAST_S_table1(,%ebx,4),%ebx
651	subl	%ebx,%ecx
652	movl	CAST_S_table2(,%eax,4),%ebx
653	addl	%ebx,%ecx
654	movl	CAST_S_table3(,%edx,4),%ebx
655	xorl	%ebx,%ecx
656	xorl	%ecx,%esi
657
658	movl	24(%ebp),%edx
659	movl	28(%ebp),%ecx
660	addl	%esi,%edx
661	roll	%cl,%edx
662	xorl	%ecx,%ecx
663	movl	$255,%ebx
664	movb	%dh,%cl
665	andl	%edx,%ebx
666	shrl	$16,%edx
667	xorl	%eax,%eax
668	movb	%dh,%al
669	andl	$255,%edx
670	movl	CAST_S_table0(,%ecx,4),%ecx
671	movl	CAST_S_table1(,%ebx,4),%ebx
672	xorl	%ebx,%ecx
673	movl	CAST_S_table2(,%eax,4),%ebx
674	subl	%ebx,%ecx
675	movl	CAST_S_table3(,%edx,4),%ebx
676	addl	%ebx,%ecx
677	xorl	%ecx,%edi
678
679	movl	16(%ebp),%edx
680	movl	20(%ebp),%ecx
681	subl	%edi,%edx
682	roll	%cl,%edx
683	xorl	%ecx,%ecx
684	movl	$255,%ebx
685	movb	%dh,%cl
686	andl	%edx,%ebx
687	shrl	$16,%edx
688	xorl	%eax,%eax
689	movb	%dh,%al
690	andl	$255,%edx
691	movl	CAST_S_table0(,%ecx,4),%ecx
692	movl	CAST_S_table1(,%ebx,4),%ebx
693	addl	%ebx,%ecx
694	movl	CAST_S_table2(,%eax,4),%ebx
695	xorl	%ebx,%ecx
696	movl	CAST_S_table3(,%edx,4),%ebx
697	subl	%ebx,%ecx
698	xorl	%ecx,%esi
699
700	movl	8(%ebp),%edx
701	movl	12(%ebp),%ecx
702	xorl	%esi,%edx
703	roll	%cl,%edx
704	xorl	%ecx,%ecx
705	movl	$255,%ebx
706	movb	%dh,%cl
707	andl	%edx,%ebx
708	shrl	$16,%edx
709	xorl	%eax,%eax
710	movb	%dh,%al
711	andl	$255,%edx
712	movl	CAST_S_table0(,%ecx,4),%ecx
713	movl	CAST_S_table1(,%ebx,4),%ebx
714	subl	%ebx,%ecx
715	movl	CAST_S_table2(,%eax,4),%ebx
716	addl	%ebx,%ecx
717	movl	CAST_S_table3(,%edx,4),%ebx
718	xorl	%ebx,%ecx
719	xorl	%ecx,%edi
720
721	movl	(%ebp),%edx
722	movl	4(%ebp),%ecx
723	addl	%edi,%edx
724	roll	%cl,%edx
725	xorl	%ecx,%ecx
726	movl	$255,%ebx
727	movb	%dh,%cl
728	andl	%edx,%ebx
729	shrl	$16,%edx
730	xorl	%eax,%eax
731	movb	%dh,%al
732	andl	$255,%edx
733	movl	CAST_S_table0(,%ecx,4),%ecx
734	movl	CAST_S_table1(,%ebx,4),%ebx
735	xorl	%ebx,%ecx
736	movl	CAST_S_table2(,%eax,4),%ebx
737	subl	%ebx,%ecx
738	movl	CAST_S_table3(,%edx,4),%ebx
739	addl	%ebx,%ecx
740	xorl	%ecx,%esi
741	nop
742	movl	20(%esp),%eax
743	movl	%edi,4(%eax)
744	movl	%esi,(%eax)
745	popl	%edi
746	popl	%esi
747	popl	%ebx
748	popl	%ebp
749	ret
750.size	CAST_decrypt,.-.L_CAST_decrypt_begin
751.globl	CAST_cbc_encrypt
752.type	CAST_cbc_encrypt,@function
753.align	16
754CAST_cbc_encrypt:
755.L_CAST_cbc_encrypt_begin:
756	#ifdef __CET__
757
758.byte	243,15,30,251
759	#endif
760
761
762	pushl	%ebp
763	pushl	%ebx
764	pushl	%esi
765	pushl	%edi
766	movl	28(%esp),%ebp
767
768	movl	36(%esp),%ebx
769	movl	(%ebx),%esi
770	movl	4(%ebx),%edi
771	pushl	%edi
772	pushl	%esi
773	pushl	%edi
774	pushl	%esi
775	movl	%esp,%ebx
776	movl	36(%esp),%esi
777	movl	40(%esp),%edi
778
779	movl	56(%esp),%ecx
780
781	movl	48(%esp),%eax
782	pushl	%eax
783	pushl	%ebx
784	cmpl	$0,%ecx
785	jz	.L002decrypt
786	andl	$4294967288,%ebp
787	movl	8(%esp),%eax
788	movl	12(%esp),%ebx
789	jz	.L003encrypt_finish
790.L004encrypt_loop:
791	movl	(%esi),%ecx
792	movl	4(%esi),%edx
793	xorl	%ecx,%eax
794	xorl	%edx,%ebx
795	bswap	%eax
796	bswap	%ebx
797	movl	%eax,8(%esp)
798	movl	%ebx,12(%esp)
799	call	.L_CAST_encrypt_begin
800	movl	8(%esp),%eax
801	movl	12(%esp),%ebx
802	bswap	%eax
803	bswap	%ebx
804	movl	%eax,(%edi)
805	movl	%ebx,4(%edi)
806	addl	$8,%esi
807	addl	$8,%edi
808	subl	$8,%ebp
809	jnz	.L004encrypt_loop
810.L003encrypt_finish:
811	movl	52(%esp),%ebp
812	andl	$7,%ebp
813	jz	.L005finish
814	call	.L006PIC_point
815.L006PIC_point:
816	popl	%edx
817	leal	.L007cbc_enc_jmp_table-.L006PIC_point(%edx),%ecx
818	movl	(%ecx,%ebp,4),%ebp
819	addl	%edx,%ebp
820	xorl	%ecx,%ecx
821	xorl	%edx,%edx
822	jmp	*%ebp
823.L008ej7:
824	#ifdef __CET__
825
826.byte	243,15,30,251
827	#endif
828
829	movb	6(%esi),%dh
830	shll	$8,%edx
831.L009ej6:
832	#ifdef __CET__
833
834.byte	243,15,30,251
835	#endif
836
837	movb	5(%esi),%dh
838.L010ej5:
839	#ifdef __CET__
840
841.byte	243,15,30,251
842	#endif
843
844	movb	4(%esi),%dl
845.L011ej4:
846	#ifdef __CET__
847
848.byte	243,15,30,251
849	#endif
850
851	movl	(%esi),%ecx
852	jmp	.L012ejend
853.L013ej3:
854	#ifdef __CET__
855
856.byte	243,15,30,251
857	#endif
858
859	movb	2(%esi),%ch
860	shll	$8,%ecx
861.L014ej2:
862	#ifdef __CET__
863
864.byte	243,15,30,251
865	#endif
866
867	movb	1(%esi),%ch
868.L015ej1:
869	#ifdef __CET__
870
871.byte	243,15,30,251
872	#endif
873
874	movb	(%esi),%cl
875.L012ejend:
876	xorl	%ecx,%eax
877	xorl	%edx,%ebx
878	bswap	%eax
879	bswap	%ebx
880	movl	%eax,8(%esp)
881	movl	%ebx,12(%esp)
882	call	.L_CAST_encrypt_begin
883	movl	8(%esp),%eax
884	movl	12(%esp),%ebx
885	bswap	%eax
886	bswap	%ebx
887	movl	%eax,(%edi)
888	movl	%ebx,4(%edi)
889	jmp	.L005finish
890.L002decrypt:
891	andl	$4294967288,%ebp
892	movl	16(%esp),%eax
893	movl	20(%esp),%ebx
894	jz	.L016decrypt_finish
895.L017decrypt_loop:
896	movl	(%esi),%eax
897	movl	4(%esi),%ebx
898	bswap	%eax
899	bswap	%ebx
900	movl	%eax,8(%esp)
901	movl	%ebx,12(%esp)
902	call	.L_CAST_decrypt_begin
903	movl	8(%esp),%eax
904	movl	12(%esp),%ebx
905	bswap	%eax
906	bswap	%ebx
907	movl	16(%esp),%ecx
908	movl	20(%esp),%edx
909	xorl	%eax,%ecx
910	xorl	%ebx,%edx
911	movl	(%esi),%eax
912	movl	4(%esi),%ebx
913	movl	%ecx,(%edi)
914	movl	%edx,4(%edi)
915	movl	%eax,16(%esp)
916	movl	%ebx,20(%esp)
917	addl	$8,%esi
918	addl	$8,%edi
919	subl	$8,%ebp
920	jnz	.L017decrypt_loop
921.L016decrypt_finish:
922	movl	52(%esp),%ebp
923	andl	$7,%ebp
924	jz	.L005finish
925	movl	(%esi),%eax
926	movl	4(%esi),%ebx
927	bswap	%eax
928	bswap	%ebx
929	movl	%eax,8(%esp)
930	movl	%ebx,12(%esp)
931	call	.L_CAST_decrypt_begin
932	movl	8(%esp),%eax
933	movl	12(%esp),%ebx
934	bswap	%eax
935	bswap	%ebx
936	movl	16(%esp),%ecx
937	movl	20(%esp),%edx
938	xorl	%eax,%ecx
939	xorl	%ebx,%edx
940	movl	(%esi),%eax
941	movl	4(%esi),%ebx
942.L018dj7:
943	rorl	$16,%edx
944	movb	%dl,6(%edi)
945	shrl	$16,%edx
946.L019dj6:
947	movb	%dh,5(%edi)
948.L020dj5:
949	movb	%dl,4(%edi)
950.L021dj4:
951	movl	%ecx,(%edi)
952	jmp	.L022djend
953.L023dj3:
954	rorl	$16,%ecx
955	movb	%cl,2(%edi)
956	shll	$16,%ecx
957.L024dj2:
958	movb	%ch,1(%esi)
959.L025dj1:
960	movb	%cl,(%esi)
961.L022djend:
962	jmp	.L005finish
963.L005finish:
964	movl	60(%esp),%ecx
965	addl	$24,%esp
966	movl	%eax,(%ecx)
967	movl	%ebx,4(%ecx)
968	popl	%edi
969	popl	%esi
970	popl	%ebx
971	popl	%ebp
972	ret
973.align	64
974.L007cbc_enc_jmp_table:
975.long	0
976.long	.L015ej1-.L006PIC_point
977.long	.L014ej2-.L006PIC_point
978.long	.L013ej3-.L006PIC_point
979.long	.L011ej4-.L006PIC_point
980.long	.L010ej5-.L006PIC_point
981.long	.L009ej6-.L006PIC_point
982.long	.L008ej7-.L006PIC_point
983.align	64
984.size	CAST_cbc_encrypt,.-.L_CAST_cbc_encrypt_begin
985
986	.section ".note.gnu.property", "a"
987	.p2align 2
988	.long 1f - 0f
989	.long 4f - 1f
990	.long 5
9910:
992	.asciz "GNU"
9931:
994	.p2align 2
995	.long 0xc0000002
996	.long 3f - 2f
9972:
998	.long 3
9993:
1000	.p2align 2
10014:
1002#else
1003.text
1004.globl	CAST_encrypt
1005.type	CAST_encrypt,@function
1006.align	16
1007CAST_encrypt:
1008.L_CAST_encrypt_begin:
1009	#ifdef __CET__
1010
1011.byte	243,15,30,251
1012	#endif
1013
1014
1015	pushl	%ebp
1016	pushl	%ebx
1017	movl	12(%esp),%ebx
1018	movl	16(%esp),%ebp
1019	pushl	%esi
1020	pushl	%edi
1021
1022	movl	(%ebx),%edi
1023	movl	4(%ebx),%esi
1024
1025	movl	128(%ebp),%eax
1026	pushl	%eax
1027	xorl	%eax,%eax
1028
1029	movl	(%ebp),%edx
1030	movl	4(%ebp),%ecx
1031	addl	%esi,%edx
1032	roll	%cl,%edx
1033	xorl	%ecx,%ecx
1034	movl	$255,%ebx
1035	movb	%dh,%cl
1036	andl	%edx,%ebx
1037	shrl	$16,%edx
1038	xorl	%eax,%eax
1039	movb	%dh,%al
1040	andl	$255,%edx
1041	movl	CAST_S_table0(,%ecx,4),%ecx
1042	movl	CAST_S_table1(,%ebx,4),%ebx
1043	xorl	%ebx,%ecx
1044	movl	CAST_S_table2(,%eax,4),%ebx
1045	subl	%ebx,%ecx
1046	movl	CAST_S_table3(,%edx,4),%ebx
1047	addl	%ebx,%ecx
1048	xorl	%ecx,%edi
1049
1050	movl	8(%ebp),%edx
1051	movl	12(%ebp),%ecx
1052	xorl	%edi,%edx
1053	roll	%cl,%edx
1054	xorl	%ecx,%ecx
1055	movl	$255,%ebx
1056	movb	%dh,%cl
1057	andl	%edx,%ebx
1058	shrl	$16,%edx
1059	xorl	%eax,%eax
1060	movb	%dh,%al
1061	andl	$255,%edx
1062	movl	CAST_S_table0(,%ecx,4),%ecx
1063	movl	CAST_S_table1(,%ebx,4),%ebx
1064	subl	%ebx,%ecx
1065	movl	CAST_S_table2(,%eax,4),%ebx
1066	addl	%ebx,%ecx
1067	movl	CAST_S_table3(,%edx,4),%ebx
1068	xorl	%ebx,%ecx
1069	xorl	%ecx,%esi
1070
1071	movl	16(%ebp),%edx
1072	movl	20(%ebp),%ecx
1073	subl	%esi,%edx
1074	roll	%cl,%edx
1075	xorl	%ecx,%ecx
1076	movl	$255,%ebx
1077	movb	%dh,%cl
1078	andl	%edx,%ebx
1079	shrl	$16,%edx
1080	xorl	%eax,%eax
1081	movb	%dh,%al
1082	andl	$255,%edx
1083	movl	CAST_S_table0(,%ecx,4),%ecx
1084	movl	CAST_S_table1(,%ebx,4),%ebx
1085	addl	%ebx,%ecx
1086	movl	CAST_S_table2(,%eax,4),%ebx
1087	xorl	%ebx,%ecx
1088	movl	CAST_S_table3(,%edx,4),%ebx
1089	subl	%ebx,%ecx
1090	xorl	%ecx,%edi
1091
1092	movl	24(%ebp),%edx
1093	movl	28(%ebp),%ecx
1094	addl	%edi,%edx
1095	roll	%cl,%edx
1096	xorl	%ecx,%ecx
1097	movl	$255,%ebx
1098	movb	%dh,%cl
1099	andl	%edx,%ebx
1100	shrl	$16,%edx
1101	xorl	%eax,%eax
1102	movb	%dh,%al
1103	andl	$255,%edx
1104	movl	CAST_S_table0(,%ecx,4),%ecx
1105	movl	CAST_S_table1(,%ebx,4),%ebx
1106	xorl	%ebx,%ecx
1107	movl	CAST_S_table2(,%eax,4),%ebx
1108	subl	%ebx,%ecx
1109	movl	CAST_S_table3(,%edx,4),%ebx
1110	addl	%ebx,%ecx
1111	xorl	%ecx,%esi
1112
1113	movl	32(%ebp),%edx
1114	movl	36(%ebp),%ecx
1115	xorl	%esi,%edx
1116	roll	%cl,%edx
1117	xorl	%ecx,%ecx
1118	movl	$255,%ebx
1119	movb	%dh,%cl
1120	andl	%edx,%ebx
1121	shrl	$16,%edx
1122	xorl	%eax,%eax
1123	movb	%dh,%al
1124	andl	$255,%edx
1125	movl	CAST_S_table0(,%ecx,4),%ecx
1126	movl	CAST_S_table1(,%ebx,4),%ebx
1127	subl	%ebx,%ecx
1128	movl	CAST_S_table2(,%eax,4),%ebx
1129	addl	%ebx,%ecx
1130	movl	CAST_S_table3(,%edx,4),%ebx
1131	xorl	%ebx,%ecx
1132	xorl	%ecx,%edi
1133
1134	movl	40(%ebp),%edx
1135	movl	44(%ebp),%ecx
1136	subl	%edi,%edx
1137	roll	%cl,%edx
1138	xorl	%ecx,%ecx
1139	movl	$255,%ebx
1140	movb	%dh,%cl
1141	andl	%edx,%ebx
1142	shrl	$16,%edx
1143	xorl	%eax,%eax
1144	movb	%dh,%al
1145	andl	$255,%edx
1146	movl	CAST_S_table0(,%ecx,4),%ecx
1147	movl	CAST_S_table1(,%ebx,4),%ebx
1148	addl	%ebx,%ecx
1149	movl	CAST_S_table2(,%eax,4),%ebx
1150	xorl	%ebx,%ecx
1151	movl	CAST_S_table3(,%edx,4),%ebx
1152	subl	%ebx,%ecx
1153	xorl	%ecx,%esi
1154
1155	movl	48(%ebp),%edx
1156	movl	52(%ebp),%ecx
1157	addl	%esi,%edx
1158	roll	%cl,%edx
1159	xorl	%ecx,%ecx
1160	movl	$255,%ebx
1161	movb	%dh,%cl
1162	andl	%edx,%ebx
1163	shrl	$16,%edx
1164	xorl	%eax,%eax
1165	movb	%dh,%al
1166	andl	$255,%edx
1167	movl	CAST_S_table0(,%ecx,4),%ecx
1168	movl	CAST_S_table1(,%ebx,4),%ebx
1169	xorl	%ebx,%ecx
1170	movl	CAST_S_table2(,%eax,4),%ebx
1171	subl	%ebx,%ecx
1172	movl	CAST_S_table3(,%edx,4),%ebx
1173	addl	%ebx,%ecx
1174	xorl	%ecx,%edi
1175
1176	movl	56(%ebp),%edx
1177	movl	60(%ebp),%ecx
1178	xorl	%edi,%edx
1179	roll	%cl,%edx
1180	xorl	%ecx,%ecx
1181	movl	$255,%ebx
1182	movb	%dh,%cl
1183	andl	%edx,%ebx
1184	shrl	$16,%edx
1185	xorl	%eax,%eax
1186	movb	%dh,%al
1187	andl	$255,%edx
1188	movl	CAST_S_table0(,%ecx,4),%ecx
1189	movl	CAST_S_table1(,%ebx,4),%ebx
1190	subl	%ebx,%ecx
1191	movl	CAST_S_table2(,%eax,4),%ebx
1192	addl	%ebx,%ecx
1193	movl	CAST_S_table3(,%edx,4),%ebx
1194	xorl	%ebx,%ecx
1195	xorl	%ecx,%esi
1196
1197	movl	64(%ebp),%edx
1198	movl	68(%ebp),%ecx
1199	subl	%esi,%edx
1200	roll	%cl,%edx
1201	xorl	%ecx,%ecx
1202	movl	$255,%ebx
1203	movb	%dh,%cl
1204	andl	%edx,%ebx
1205	shrl	$16,%edx
1206	xorl	%eax,%eax
1207	movb	%dh,%al
1208	andl	$255,%edx
1209	movl	CAST_S_table0(,%ecx,4),%ecx
1210	movl	CAST_S_table1(,%ebx,4),%ebx
1211	addl	%ebx,%ecx
1212	movl	CAST_S_table2(,%eax,4),%ebx
1213	xorl	%ebx,%ecx
1214	movl	CAST_S_table3(,%edx,4),%ebx
1215	subl	%ebx,%ecx
1216	xorl	%ecx,%edi
1217
1218	movl	72(%ebp),%edx
1219	movl	76(%ebp),%ecx
1220	addl	%edi,%edx
1221	roll	%cl,%edx
1222	xorl	%ecx,%ecx
1223	movl	$255,%ebx
1224	movb	%dh,%cl
1225	andl	%edx,%ebx
1226	shrl	$16,%edx
1227	xorl	%eax,%eax
1228	movb	%dh,%al
1229	andl	$255,%edx
1230	movl	CAST_S_table0(,%ecx,4),%ecx
1231	movl	CAST_S_table1(,%ebx,4),%ebx
1232	xorl	%ebx,%ecx
1233	movl	CAST_S_table2(,%eax,4),%ebx
1234	subl	%ebx,%ecx
1235	movl	CAST_S_table3(,%edx,4),%ebx
1236	addl	%ebx,%ecx
1237	xorl	%ecx,%esi
1238
1239	movl	80(%ebp),%edx
1240	movl	84(%ebp),%ecx
1241	xorl	%esi,%edx
1242	roll	%cl,%edx
1243	xorl	%ecx,%ecx
1244	movl	$255,%ebx
1245	movb	%dh,%cl
1246	andl	%edx,%ebx
1247	shrl	$16,%edx
1248	xorl	%eax,%eax
1249	movb	%dh,%al
1250	andl	$255,%edx
1251	movl	CAST_S_table0(,%ecx,4),%ecx
1252	movl	CAST_S_table1(,%ebx,4),%ebx
1253	subl	%ebx,%ecx
1254	movl	CAST_S_table2(,%eax,4),%ebx
1255	addl	%ebx,%ecx
1256	movl	CAST_S_table3(,%edx,4),%ebx
1257	xorl	%ebx,%ecx
1258	xorl	%ecx,%edi
1259
1260	movl	88(%ebp),%edx
1261	movl	92(%ebp),%ecx
1262	subl	%edi,%edx
1263	roll	%cl,%edx
1264	xorl	%ecx,%ecx
1265	movl	$255,%ebx
1266	movb	%dh,%cl
1267	andl	%edx,%ebx
1268	shrl	$16,%edx
1269	xorl	%eax,%eax
1270	movb	%dh,%al
1271	andl	$255,%edx
1272	movl	CAST_S_table0(,%ecx,4),%ecx
1273	movl	CAST_S_table1(,%ebx,4),%ebx
1274	addl	%ebx,%ecx
1275	movl	CAST_S_table2(,%eax,4),%ebx
1276	xorl	%ebx,%ecx
1277	movl	CAST_S_table3(,%edx,4),%ebx
1278	subl	%ebx,%ecx
1279	xorl	%ecx,%esi
1280
1281	popl	%edx
1282	orl	%edx,%edx
1283	jnz	.L000cast_enc_done
1284
1285	movl	96(%ebp),%edx
1286	movl	100(%ebp),%ecx
1287	addl	%esi,%edx
1288	roll	%cl,%edx
1289	xorl	%ecx,%ecx
1290	movl	$255,%ebx
1291	movb	%dh,%cl
1292	andl	%edx,%ebx
1293	shrl	$16,%edx
1294	xorl	%eax,%eax
1295	movb	%dh,%al
1296	andl	$255,%edx
1297	movl	CAST_S_table0(,%ecx,4),%ecx
1298	movl	CAST_S_table1(,%ebx,4),%ebx
1299	xorl	%ebx,%ecx
1300	movl	CAST_S_table2(,%eax,4),%ebx
1301	subl	%ebx,%ecx
1302	movl	CAST_S_table3(,%edx,4),%ebx
1303	addl	%ebx,%ecx
1304	xorl	%ecx,%edi
1305
1306	movl	104(%ebp),%edx
1307	movl	108(%ebp),%ecx
1308	xorl	%edi,%edx
1309	roll	%cl,%edx
1310	xorl	%ecx,%ecx
1311	movl	$255,%ebx
1312	movb	%dh,%cl
1313	andl	%edx,%ebx
1314	shrl	$16,%edx
1315	xorl	%eax,%eax
1316	movb	%dh,%al
1317	andl	$255,%edx
1318	movl	CAST_S_table0(,%ecx,4),%ecx
1319	movl	CAST_S_table1(,%ebx,4),%ebx
1320	subl	%ebx,%ecx
1321	movl	CAST_S_table2(,%eax,4),%ebx
1322	addl	%ebx,%ecx
1323	movl	CAST_S_table3(,%edx,4),%ebx
1324	xorl	%ebx,%ecx
1325	xorl	%ecx,%esi
1326
1327	movl	112(%ebp),%edx
1328	movl	116(%ebp),%ecx
1329	subl	%esi,%edx
1330	roll	%cl,%edx
1331	xorl	%ecx,%ecx
1332	movl	$255,%ebx
1333	movb	%dh,%cl
1334	andl	%edx,%ebx
1335	shrl	$16,%edx
1336	xorl	%eax,%eax
1337	movb	%dh,%al
1338	andl	$255,%edx
1339	movl	CAST_S_table0(,%ecx,4),%ecx
1340	movl	CAST_S_table1(,%ebx,4),%ebx
1341	addl	%ebx,%ecx
1342	movl	CAST_S_table2(,%eax,4),%ebx
1343	xorl	%ebx,%ecx
1344	movl	CAST_S_table3(,%edx,4),%ebx
1345	subl	%ebx,%ecx
1346	xorl	%ecx,%edi
1347
1348	movl	120(%ebp),%edx
1349	movl	124(%ebp),%ecx
1350	addl	%edi,%edx
1351	roll	%cl,%edx
1352	xorl	%ecx,%ecx
1353	movl	$255,%ebx
1354	movb	%dh,%cl
1355	andl	%edx,%ebx
1356	shrl	$16,%edx
1357	xorl	%eax,%eax
1358	movb	%dh,%al
1359	andl	$255,%edx
1360	movl	CAST_S_table0(,%ecx,4),%ecx
1361	movl	CAST_S_table1(,%ebx,4),%ebx
1362	xorl	%ebx,%ecx
1363	movl	CAST_S_table2(,%eax,4),%ebx
1364	subl	%ebx,%ecx
1365	movl	CAST_S_table3(,%edx,4),%ebx
1366	addl	%ebx,%ecx
1367	xorl	%ecx,%esi
1368.L000cast_enc_done:
1369	nop
1370	movl	20(%esp),%eax
1371	movl	%edi,4(%eax)
1372	movl	%esi,(%eax)
1373	popl	%edi
1374	popl	%esi
1375	popl	%ebx
1376	popl	%ebp
1377	ret
1378.size	CAST_encrypt,.-.L_CAST_encrypt_begin
1379.globl	CAST_decrypt
1380.type	CAST_decrypt,@function
1381.align	16
1382CAST_decrypt:
1383.L_CAST_decrypt_begin:
1384	#ifdef __CET__
1385
1386.byte	243,15,30,251
1387	#endif
1388
1389
1390	pushl	%ebp
1391	pushl	%ebx
1392	movl	12(%esp),%ebx
1393	movl	16(%esp),%ebp
1394	pushl	%esi
1395	pushl	%edi
1396
1397	movl	(%ebx),%edi
1398	movl	4(%ebx),%esi
1399
1400	movl	128(%ebp),%eax
1401	orl	%eax,%eax
1402	jnz	.L001cast_dec_skip
1403	xorl	%eax,%eax
1404
1405	movl	120(%ebp),%edx
1406	movl	124(%ebp),%ecx
1407	addl	%esi,%edx
1408	roll	%cl,%edx
1409	xorl	%ecx,%ecx
1410	movl	$255,%ebx
1411	movb	%dh,%cl
1412	andl	%edx,%ebx
1413	shrl	$16,%edx
1414	xorl	%eax,%eax
1415	movb	%dh,%al
1416	andl	$255,%edx
1417	movl	CAST_S_table0(,%ecx,4),%ecx
1418	movl	CAST_S_table1(,%ebx,4),%ebx
1419	xorl	%ebx,%ecx
1420	movl	CAST_S_table2(,%eax,4),%ebx
1421	subl	%ebx,%ecx
1422	movl	CAST_S_table3(,%edx,4),%ebx
1423	addl	%ebx,%ecx
1424	xorl	%ecx,%edi
1425
1426	movl	112(%ebp),%edx
1427	movl	116(%ebp),%ecx
1428	subl	%edi,%edx
1429	roll	%cl,%edx
1430	xorl	%ecx,%ecx
1431	movl	$255,%ebx
1432	movb	%dh,%cl
1433	andl	%edx,%ebx
1434	shrl	$16,%edx
1435	xorl	%eax,%eax
1436	movb	%dh,%al
1437	andl	$255,%edx
1438	movl	CAST_S_table0(,%ecx,4),%ecx
1439	movl	CAST_S_table1(,%ebx,4),%ebx
1440	addl	%ebx,%ecx
1441	movl	CAST_S_table2(,%eax,4),%ebx
1442	xorl	%ebx,%ecx
1443	movl	CAST_S_table3(,%edx,4),%ebx
1444	subl	%ebx,%ecx
1445	xorl	%ecx,%esi
1446
1447	movl	104(%ebp),%edx
1448	movl	108(%ebp),%ecx
1449	xorl	%esi,%edx
1450	roll	%cl,%edx
1451	xorl	%ecx,%ecx
1452	movl	$255,%ebx
1453	movb	%dh,%cl
1454	andl	%edx,%ebx
1455	shrl	$16,%edx
1456	xorl	%eax,%eax
1457	movb	%dh,%al
1458	andl	$255,%edx
1459	movl	CAST_S_table0(,%ecx,4),%ecx
1460	movl	CAST_S_table1(,%ebx,4),%ebx
1461	subl	%ebx,%ecx
1462	movl	CAST_S_table2(,%eax,4),%ebx
1463	addl	%ebx,%ecx
1464	movl	CAST_S_table3(,%edx,4),%ebx
1465	xorl	%ebx,%ecx
1466	xorl	%ecx,%edi
1467
1468	movl	96(%ebp),%edx
1469	movl	100(%ebp),%ecx
1470	addl	%edi,%edx
1471	roll	%cl,%edx
1472	xorl	%ecx,%ecx
1473	movl	$255,%ebx
1474	movb	%dh,%cl
1475	andl	%edx,%ebx
1476	shrl	$16,%edx
1477	xorl	%eax,%eax
1478	movb	%dh,%al
1479	andl	$255,%edx
1480	movl	CAST_S_table0(,%ecx,4),%ecx
1481	movl	CAST_S_table1(,%ebx,4),%ebx
1482	xorl	%ebx,%ecx
1483	movl	CAST_S_table2(,%eax,4),%ebx
1484	subl	%ebx,%ecx
1485	movl	CAST_S_table3(,%edx,4),%ebx
1486	addl	%ebx,%ecx
1487	xorl	%ecx,%esi
1488.L001cast_dec_skip:
1489
1490	movl	88(%ebp),%edx
1491	movl	92(%ebp),%ecx
1492	subl	%esi,%edx
1493	roll	%cl,%edx
1494	xorl	%ecx,%ecx
1495	movl	$255,%ebx
1496	movb	%dh,%cl
1497	andl	%edx,%ebx
1498	shrl	$16,%edx
1499	xorl	%eax,%eax
1500	movb	%dh,%al
1501	andl	$255,%edx
1502	movl	CAST_S_table0(,%ecx,4),%ecx
1503	movl	CAST_S_table1(,%ebx,4),%ebx
1504	addl	%ebx,%ecx
1505	movl	CAST_S_table2(,%eax,4),%ebx
1506	xorl	%ebx,%ecx
1507	movl	CAST_S_table3(,%edx,4),%ebx
1508	subl	%ebx,%ecx
1509	xorl	%ecx,%edi
1510
1511	movl	80(%ebp),%edx
1512	movl	84(%ebp),%ecx
1513	xorl	%edi,%edx
1514	roll	%cl,%edx
1515	xorl	%ecx,%ecx
1516	movl	$255,%ebx
1517	movb	%dh,%cl
1518	andl	%edx,%ebx
1519	shrl	$16,%edx
1520	xorl	%eax,%eax
1521	movb	%dh,%al
1522	andl	$255,%edx
1523	movl	CAST_S_table0(,%ecx,4),%ecx
1524	movl	CAST_S_table1(,%ebx,4),%ebx
1525	subl	%ebx,%ecx
1526	movl	CAST_S_table2(,%eax,4),%ebx
1527	addl	%ebx,%ecx
1528	movl	CAST_S_table3(,%edx,4),%ebx
1529	xorl	%ebx,%ecx
1530	xorl	%ecx,%esi
1531
1532	movl	72(%ebp),%edx
1533	movl	76(%ebp),%ecx
1534	addl	%esi,%edx
1535	roll	%cl,%edx
1536	xorl	%ecx,%ecx
1537	movl	$255,%ebx
1538	movb	%dh,%cl
1539	andl	%edx,%ebx
1540	shrl	$16,%edx
1541	xorl	%eax,%eax
1542	movb	%dh,%al
1543	andl	$255,%edx
1544	movl	CAST_S_table0(,%ecx,4),%ecx
1545	movl	CAST_S_table1(,%ebx,4),%ebx
1546	xorl	%ebx,%ecx
1547	movl	CAST_S_table2(,%eax,4),%ebx
1548	subl	%ebx,%ecx
1549	movl	CAST_S_table3(,%edx,4),%ebx
1550	addl	%ebx,%ecx
1551	xorl	%ecx,%edi
1552
1553	movl	64(%ebp),%edx
1554	movl	68(%ebp),%ecx
1555	subl	%edi,%edx
1556	roll	%cl,%edx
1557	xorl	%ecx,%ecx
1558	movl	$255,%ebx
1559	movb	%dh,%cl
1560	andl	%edx,%ebx
1561	shrl	$16,%edx
1562	xorl	%eax,%eax
1563	movb	%dh,%al
1564	andl	$255,%edx
1565	movl	CAST_S_table0(,%ecx,4),%ecx
1566	movl	CAST_S_table1(,%ebx,4),%ebx
1567	addl	%ebx,%ecx
1568	movl	CAST_S_table2(,%eax,4),%ebx
1569	xorl	%ebx,%ecx
1570	movl	CAST_S_table3(,%edx,4),%ebx
1571	subl	%ebx,%ecx
1572	xorl	%ecx,%esi
1573
1574	movl	56(%ebp),%edx
1575	movl	60(%ebp),%ecx
1576	xorl	%esi,%edx
1577	roll	%cl,%edx
1578	xorl	%ecx,%ecx
1579	movl	$255,%ebx
1580	movb	%dh,%cl
1581	andl	%edx,%ebx
1582	shrl	$16,%edx
1583	xorl	%eax,%eax
1584	movb	%dh,%al
1585	andl	$255,%edx
1586	movl	CAST_S_table0(,%ecx,4),%ecx
1587	movl	CAST_S_table1(,%ebx,4),%ebx
1588	subl	%ebx,%ecx
1589	movl	CAST_S_table2(,%eax,4),%ebx
1590	addl	%ebx,%ecx
1591	movl	CAST_S_table3(,%edx,4),%ebx
1592	xorl	%ebx,%ecx
1593	xorl	%ecx,%edi
1594
1595	movl	48(%ebp),%edx
1596	movl	52(%ebp),%ecx
1597	addl	%edi,%edx
1598	roll	%cl,%edx
1599	xorl	%ecx,%ecx
1600	movl	$255,%ebx
1601	movb	%dh,%cl
1602	andl	%edx,%ebx
1603	shrl	$16,%edx
1604	xorl	%eax,%eax
1605	movb	%dh,%al
1606	andl	$255,%edx
1607	movl	CAST_S_table0(,%ecx,4),%ecx
1608	movl	CAST_S_table1(,%ebx,4),%ebx
1609	xorl	%ebx,%ecx
1610	movl	CAST_S_table2(,%eax,4),%ebx
1611	subl	%ebx,%ecx
1612	movl	CAST_S_table3(,%edx,4),%ebx
1613	addl	%ebx,%ecx
1614	xorl	%ecx,%esi
1615
1616	movl	40(%ebp),%edx
1617	movl	44(%ebp),%ecx
1618	subl	%esi,%edx
1619	roll	%cl,%edx
1620	xorl	%ecx,%ecx
1621	movl	$255,%ebx
1622	movb	%dh,%cl
1623	andl	%edx,%ebx
1624	shrl	$16,%edx
1625	xorl	%eax,%eax
1626	movb	%dh,%al
1627	andl	$255,%edx
1628	movl	CAST_S_table0(,%ecx,4),%ecx
1629	movl	CAST_S_table1(,%ebx,4),%ebx
1630	addl	%ebx,%ecx
1631	movl	CAST_S_table2(,%eax,4),%ebx
1632	xorl	%ebx,%ecx
1633	movl	CAST_S_table3(,%edx,4),%ebx
1634	subl	%ebx,%ecx
1635	xorl	%ecx,%edi
1636
1637	movl	32(%ebp),%edx
1638	movl	36(%ebp),%ecx
1639	xorl	%edi,%edx
1640	roll	%cl,%edx
1641	xorl	%ecx,%ecx
1642	movl	$255,%ebx
1643	movb	%dh,%cl
1644	andl	%edx,%ebx
1645	shrl	$16,%edx
1646	xorl	%eax,%eax
1647	movb	%dh,%al
1648	andl	$255,%edx
1649	movl	CAST_S_table0(,%ecx,4),%ecx
1650	movl	CAST_S_table1(,%ebx,4),%ebx
1651	subl	%ebx,%ecx
1652	movl	CAST_S_table2(,%eax,4),%ebx
1653	addl	%ebx,%ecx
1654	movl	CAST_S_table3(,%edx,4),%ebx
1655	xorl	%ebx,%ecx
1656	xorl	%ecx,%esi
1657
1658	movl	24(%ebp),%edx
1659	movl	28(%ebp),%ecx
1660	addl	%esi,%edx
1661	roll	%cl,%edx
1662	xorl	%ecx,%ecx
1663	movl	$255,%ebx
1664	movb	%dh,%cl
1665	andl	%edx,%ebx
1666	shrl	$16,%edx
1667	xorl	%eax,%eax
1668	movb	%dh,%al
1669	andl	$255,%edx
1670	movl	CAST_S_table0(,%ecx,4),%ecx
1671	movl	CAST_S_table1(,%ebx,4),%ebx
1672	xorl	%ebx,%ecx
1673	movl	CAST_S_table2(,%eax,4),%ebx
1674	subl	%ebx,%ecx
1675	movl	CAST_S_table3(,%edx,4),%ebx
1676	addl	%ebx,%ecx
1677	xorl	%ecx,%edi
1678
1679	movl	16(%ebp),%edx
1680	movl	20(%ebp),%ecx
1681	subl	%edi,%edx
1682	roll	%cl,%edx
1683	xorl	%ecx,%ecx
1684	movl	$255,%ebx
1685	movb	%dh,%cl
1686	andl	%edx,%ebx
1687	shrl	$16,%edx
1688	xorl	%eax,%eax
1689	movb	%dh,%al
1690	andl	$255,%edx
1691	movl	CAST_S_table0(,%ecx,4),%ecx
1692	movl	CAST_S_table1(,%ebx,4),%ebx
1693	addl	%ebx,%ecx
1694	movl	CAST_S_table2(,%eax,4),%ebx
1695	xorl	%ebx,%ecx
1696	movl	CAST_S_table3(,%edx,4),%ebx
1697	subl	%ebx,%ecx
1698	xorl	%ecx,%esi
1699
1700	movl	8(%ebp),%edx
1701	movl	12(%ebp),%ecx
1702	xorl	%esi,%edx
1703	roll	%cl,%edx
1704	xorl	%ecx,%ecx
1705	movl	$255,%ebx
1706	movb	%dh,%cl
1707	andl	%edx,%ebx
1708	shrl	$16,%edx
1709	xorl	%eax,%eax
1710	movb	%dh,%al
1711	andl	$255,%edx
1712	movl	CAST_S_table0(,%ecx,4),%ecx
1713	movl	CAST_S_table1(,%ebx,4),%ebx
1714	subl	%ebx,%ecx
1715	movl	CAST_S_table2(,%eax,4),%ebx
1716	addl	%ebx,%ecx
1717	movl	CAST_S_table3(,%edx,4),%ebx
1718	xorl	%ebx,%ecx
1719	xorl	%ecx,%edi
1720
1721	movl	(%ebp),%edx
1722	movl	4(%ebp),%ecx
1723	addl	%edi,%edx
1724	roll	%cl,%edx
1725	xorl	%ecx,%ecx
1726	movl	$255,%ebx
1727	movb	%dh,%cl
1728	andl	%edx,%ebx
1729	shrl	$16,%edx
1730	xorl	%eax,%eax
1731	movb	%dh,%al
1732	andl	$255,%edx
1733	movl	CAST_S_table0(,%ecx,4),%ecx
1734	movl	CAST_S_table1(,%ebx,4),%ebx
1735	xorl	%ebx,%ecx
1736	movl	CAST_S_table2(,%eax,4),%ebx
1737	subl	%ebx,%ecx
1738	movl	CAST_S_table3(,%edx,4),%ebx
1739	addl	%ebx,%ecx
1740	xorl	%ecx,%esi
1741	nop
1742	movl	20(%esp),%eax
1743	movl	%edi,4(%eax)
1744	movl	%esi,(%eax)
1745	popl	%edi
1746	popl	%esi
1747	popl	%ebx
1748	popl	%ebp
1749	ret
1750.size	CAST_decrypt,.-.L_CAST_decrypt_begin
1751.globl	CAST_cbc_encrypt
1752.type	CAST_cbc_encrypt,@function
1753.align	16
1754CAST_cbc_encrypt:
1755.L_CAST_cbc_encrypt_begin:
1756	#ifdef __CET__
1757
1758.byte	243,15,30,251
1759	#endif
1760
1761
1762	pushl	%ebp
1763	pushl	%ebx
1764	pushl	%esi
1765	pushl	%edi
1766	movl	28(%esp),%ebp
1767
1768	movl	36(%esp),%ebx
1769	movl	(%ebx),%esi
1770	movl	4(%ebx),%edi
1771	pushl	%edi
1772	pushl	%esi
1773	pushl	%edi
1774	pushl	%esi
1775	movl	%esp,%ebx
1776	movl	36(%esp),%esi
1777	movl	40(%esp),%edi
1778
1779	movl	56(%esp),%ecx
1780
1781	movl	48(%esp),%eax
1782	pushl	%eax
1783	pushl	%ebx
1784	cmpl	$0,%ecx
1785	jz	.L002decrypt
1786	andl	$4294967288,%ebp
1787	movl	8(%esp),%eax
1788	movl	12(%esp),%ebx
1789	jz	.L003encrypt_finish
1790.L004encrypt_loop:
1791	movl	(%esi),%ecx
1792	movl	4(%esi),%edx
1793	xorl	%ecx,%eax
1794	xorl	%edx,%ebx
1795	bswap	%eax
1796	bswap	%ebx
1797	movl	%eax,8(%esp)
1798	movl	%ebx,12(%esp)
1799	call	.L_CAST_encrypt_begin
1800	movl	8(%esp),%eax
1801	movl	12(%esp),%ebx
1802	bswap	%eax
1803	bswap	%ebx
1804	movl	%eax,(%edi)
1805	movl	%ebx,4(%edi)
1806	addl	$8,%esi
1807	addl	$8,%edi
1808	subl	$8,%ebp
1809	jnz	.L004encrypt_loop
1810.L003encrypt_finish:
1811	movl	52(%esp),%ebp
1812	andl	$7,%ebp
1813	jz	.L005finish
1814	call	.L006PIC_point
1815.L006PIC_point:
1816	popl	%edx
1817	leal	.L007cbc_enc_jmp_table-.L006PIC_point(%edx),%ecx
1818	movl	(%ecx,%ebp,4),%ebp
1819	addl	%edx,%ebp
1820	xorl	%ecx,%ecx
1821	xorl	%edx,%edx
1822	jmp	*%ebp
1823.L008ej7:
1824	#ifdef __CET__
1825
1826.byte	243,15,30,251
1827	#endif
1828
1829	movb	6(%esi),%dh
1830	shll	$8,%edx
1831.L009ej6:
1832	#ifdef __CET__
1833
1834.byte	243,15,30,251
1835	#endif
1836
1837	movb	5(%esi),%dh
1838.L010ej5:
1839	#ifdef __CET__
1840
1841.byte	243,15,30,251
1842	#endif
1843
1844	movb	4(%esi),%dl
1845.L011ej4:
1846	#ifdef __CET__
1847
1848.byte	243,15,30,251
1849	#endif
1850
1851	movl	(%esi),%ecx
1852	jmp	.L012ejend
1853.L013ej3:
1854	#ifdef __CET__
1855
1856.byte	243,15,30,251
1857	#endif
1858
1859	movb	2(%esi),%ch
1860	shll	$8,%ecx
1861.L014ej2:
1862	#ifdef __CET__
1863
1864.byte	243,15,30,251
1865	#endif
1866
1867	movb	1(%esi),%ch
1868.L015ej1:
1869	#ifdef __CET__
1870
1871.byte	243,15,30,251
1872	#endif
1873
1874	movb	(%esi),%cl
1875.L012ejend:
1876	xorl	%ecx,%eax
1877	xorl	%edx,%ebx
1878	bswap	%eax
1879	bswap	%ebx
1880	movl	%eax,8(%esp)
1881	movl	%ebx,12(%esp)
1882	call	.L_CAST_encrypt_begin
1883	movl	8(%esp),%eax
1884	movl	12(%esp),%ebx
1885	bswap	%eax
1886	bswap	%ebx
1887	movl	%eax,(%edi)
1888	movl	%ebx,4(%edi)
1889	jmp	.L005finish
1890.L002decrypt:
1891	andl	$4294967288,%ebp
1892	movl	16(%esp),%eax
1893	movl	20(%esp),%ebx
1894	jz	.L016decrypt_finish
1895.L017decrypt_loop:
1896	movl	(%esi),%eax
1897	movl	4(%esi),%ebx
1898	bswap	%eax
1899	bswap	%ebx
1900	movl	%eax,8(%esp)
1901	movl	%ebx,12(%esp)
1902	call	.L_CAST_decrypt_begin
1903	movl	8(%esp),%eax
1904	movl	12(%esp),%ebx
1905	bswap	%eax
1906	bswap	%ebx
1907	movl	16(%esp),%ecx
1908	movl	20(%esp),%edx
1909	xorl	%eax,%ecx
1910	xorl	%ebx,%edx
1911	movl	(%esi),%eax
1912	movl	4(%esi),%ebx
1913	movl	%ecx,(%edi)
1914	movl	%edx,4(%edi)
1915	movl	%eax,16(%esp)
1916	movl	%ebx,20(%esp)
1917	addl	$8,%esi
1918	addl	$8,%edi
1919	subl	$8,%ebp
1920	jnz	.L017decrypt_loop
1921.L016decrypt_finish:
1922	movl	52(%esp),%ebp
1923	andl	$7,%ebp
1924	jz	.L005finish
1925	movl	(%esi),%eax
1926	movl	4(%esi),%ebx
1927	bswap	%eax
1928	bswap	%ebx
1929	movl	%eax,8(%esp)
1930	movl	%ebx,12(%esp)
1931	call	.L_CAST_decrypt_begin
1932	movl	8(%esp),%eax
1933	movl	12(%esp),%ebx
1934	bswap	%eax
1935	bswap	%ebx
1936	movl	16(%esp),%ecx
1937	movl	20(%esp),%edx
1938	xorl	%eax,%ecx
1939	xorl	%ebx,%edx
1940	movl	(%esi),%eax
1941	movl	4(%esi),%ebx
1942.L018dj7:
1943	rorl	$16,%edx
1944	movb	%dl,6(%edi)
1945	shrl	$16,%edx
1946.L019dj6:
1947	movb	%dh,5(%edi)
1948.L020dj5:
1949	movb	%dl,4(%edi)
1950.L021dj4:
1951	movl	%ecx,(%edi)
1952	jmp	.L022djend
1953.L023dj3:
1954	rorl	$16,%ecx
1955	movb	%cl,2(%edi)
1956	shll	$16,%ecx
1957.L024dj2:
1958	movb	%ch,1(%esi)
1959.L025dj1:
1960	movb	%cl,(%esi)
1961.L022djend:
1962	jmp	.L005finish
1963.L005finish:
1964	movl	60(%esp),%ecx
1965	addl	$24,%esp
1966	movl	%eax,(%ecx)
1967	movl	%ebx,4(%ecx)
1968	popl	%edi
1969	popl	%esi
1970	popl	%ebx
1971	popl	%ebp
1972	ret
1973.align	64
1974.L007cbc_enc_jmp_table:
1975.long	0
1976.long	.L015ej1-.L006PIC_point
1977.long	.L014ej2-.L006PIC_point
1978.long	.L013ej3-.L006PIC_point
1979.long	.L011ej4-.L006PIC_point
1980.long	.L010ej5-.L006PIC_point
1981.long	.L009ej6-.L006PIC_point
1982.long	.L008ej7-.L006PIC_point
1983.align	64
1984.size	CAST_cbc_encrypt,.-.L_CAST_cbc_encrypt_begin
1985
1986	.section ".note.gnu.property", "a"
1987	.p2align 2
1988	.long 1f - 0f
1989	.long 4f - 1f
1990	.long 5
19910:
1992	.asciz "GNU"
19931:
1994	.p2align 2
1995	.long 0xc0000002
1996	.long 3f - 2f
19972:
1998	.long 3
19993:
2000	.p2align 2
20014:
2002#endif
2003