Merge from vendor branch ZLIB:
[dragonfly.git] / sys / crypto / blowfish / arch / i386 / bf_enc_686.S
1 /*      $NetBSD: bf_enc_686.S,v 1.1 2001/09/09 11:01:02 tls Exp $       */
2 /*      $FreeBSD: src/sys/crypto/blowfish/arch/i386/bf_enc_686.S,v 1.1.2.1 2002/03/26 10:12:24 ume Exp $        */
3 /*      $DragonFly: src/sys/crypto/blowfish/arch/i386/bf_enc_686.S,v 1.2 2003/06/17 04:28:20 dillon Exp $       */
4
5 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
6  * All rights reserved.
7  *
8  * This package is an SSL implementation written
9  * by Eric Young (eay@cryptsoft.com).
10  * The implementation was written so as to conform with Netscapes SSL.
11  * 
12  * This library is free for commercial and non-commercial use as long as
13  * the following conditions are aheared to.  The following conditions
14  * apply to all code found in this distribution, be it the RC4, RSA,
15  * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
16  * included with this distribution is covered by the same copyright terms
17  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
18  * 
19  * Copyright remains Eric Young's, and as such any Copyright notices in
20  * the code are not to be removed.
21  * If this package is used in a product, Eric Young should be given attribution
22  * as the author of the parts of the library used.
23  * This can be in the form of a textual message at program startup or
24  * in documentation (online or textual) provided with the package.
25  * 
26  * Redistribution and use in source and binary forms, with or without
27  * modification, are permitted provided that the following conditions
28  * are met:
29  * 1. Redistributions of source code must retain the copyright
30  *    notice, this list of conditions and the following disclaimer.
31  * 2. Redistributions in binary form must reproduce the above copyright
32  *    notice, this list of conditions and the following disclaimer in the
33  *    documentation and/or other materials provided with the distribution.
34  * 3. All advertising materials mentioning features or use of this software
35  *    must display the following acknowledgement:
36  *    "This product includes cryptographic software written by
37  *     Eric Young (eay@cryptsoft.com)"
38  *    The word 'cryptographic' can be left out if the rouines from the library
39  *    being used are not cryptographic related :-).
40  * 4. If you include any Windows specific code (or a derivative thereof) from 
41  *    the apps directory (application code) you must include an acknowledgement:
42  *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
43  * 
44  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
45  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
46  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
47  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
48  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
49  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
50  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
51  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
52  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
53  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
54  * SUCH DAMAGE.
55  * 
56  * The licence and distribution terms for any publically available version or
57  * derivative of this code cannot be changed.  i.e. this code cannot simply be
58  * copied and put under another distribution licence
59  * [including the GNU Public Licence.]
60  */
61
62 /*
63  * Modified from the output of `perl bf-686.pl elf' by
64  * Jason R. Thorpe <thorpej@zembu.com> and Thor Lancelot Simon
65  * <tls@netbsd.org>
66  */
67
68 #include <i386/include/asm.h>
69 #define _C_LABEL        CNAME
70
71 ENTRY(BF_encrypt)
72         pushl   %ebp
73         pushl   %ebx
74         pushl   %esi
75         pushl   %edi
76
77
78         /* Load the 2 words */
79         movl    20(%esp),       %eax
80         movl    (%eax),         %ecx
81         movl    4(%eax),        %edx
82
83         /* P pointer, s and enc flag */
84         movl    24(%esp),       %edi
85         xorl    %eax,           %eax
86         xorl    %ebx,           %ebx
87         xorl    (%edi),         %ecx
88
89         /* Round 0 */
90         rorl    $16,            %ecx
91         movl    4(%edi),        %esi
92         movb    %ch,            %al
93         movb    %cl,            %bl
94         rorl    $16,            %ecx
95         xorl    %esi,           %edx
96         movl    72(%edi,%eax,4),%esi
97         movl    1096(%edi,%ebx,4),%ebp
98         movb    %ch,            %al
99         movb    %cl,            %bl
100         addl    %ebp,           %esi
101         movl    2120(%edi,%eax,4),%eax
102         xorl    %eax,           %esi
103         movl    3144(%edi,%ebx,4),%ebp
104         addl    %ebp,           %esi
105         xorl    %eax,           %eax
106         xorl    %esi,           %edx
107
108         /* Round 1 */
109         rorl    $16,            %edx
110         movl    8(%edi),        %esi
111         movb    %dh,            %al
112         movb    %dl,            %bl
113         rorl    $16,            %edx
114         xorl    %esi,           %ecx
115         movl    72(%edi,%eax,4),%esi
116         movl    1096(%edi,%ebx,4),%ebp
117         movb    %dh,            %al
118         movb    %dl,            %bl
119         addl    %ebp,           %esi
120         movl    2120(%edi,%eax,4),%eax
121         xorl    %eax,           %esi
122         movl    3144(%edi,%ebx,4),%ebp
123         addl    %ebp,           %esi
124         xorl    %eax,           %eax
125         xorl    %esi,           %ecx
126
127         /* Round 2 */
128         rorl    $16,            %ecx
129         movl    12(%edi),       %esi
130         movb    %ch,            %al
131         movb    %cl,            %bl
132         rorl    $16,            %ecx
133         xorl    %esi,           %edx
134         movl    72(%edi,%eax,4),%esi
135         movl    1096(%edi,%ebx,4),%ebp
136         movb    %ch,            %al
137         movb    %cl,            %bl
138         addl    %ebp,           %esi
139         movl    2120(%edi,%eax,4),%eax
140         xorl    %eax,           %esi
141         movl    3144(%edi,%ebx,4),%ebp
142         addl    %ebp,           %esi
143         xorl    %eax,           %eax
144         xorl    %esi,           %edx
145
146         /* Round 3 */
147         rorl    $16,            %edx
148         movl    16(%edi),       %esi
149         movb    %dh,            %al
150         movb    %dl,            %bl
151         rorl    $16,            %edx
152         xorl    %esi,           %ecx
153         movl    72(%edi,%eax,4),%esi
154         movl    1096(%edi,%ebx,4),%ebp
155         movb    %dh,            %al
156         movb    %dl,            %bl
157         addl    %ebp,           %esi
158         movl    2120(%edi,%eax,4),%eax
159         xorl    %eax,           %esi
160         movl    3144(%edi,%ebx,4),%ebp
161         addl    %ebp,           %esi
162         xorl    %eax,           %eax
163         xorl    %esi,           %ecx
164
165         /* Round 4 */
166         rorl    $16,            %ecx
167         movl    20(%edi),       %esi
168         movb    %ch,            %al
169         movb    %cl,            %bl
170         rorl    $16,            %ecx
171         xorl    %esi,           %edx
172         movl    72(%edi,%eax,4),%esi
173         movl    1096(%edi,%ebx,4),%ebp
174         movb    %ch,            %al
175         movb    %cl,            %bl
176         addl    %ebp,           %esi
177         movl    2120(%edi,%eax,4),%eax
178         xorl    %eax,           %esi
179         movl    3144(%edi,%ebx,4),%ebp
180         addl    %ebp,           %esi
181         xorl    %eax,           %eax
182         xorl    %esi,           %edx
183
184         /* Round 5 */
185         rorl    $16,            %edx
186         movl    24(%edi),       %esi
187         movb    %dh,            %al
188         movb    %dl,            %bl
189         rorl    $16,            %edx
190         xorl    %esi,           %ecx
191         movl    72(%edi,%eax,4),%esi
192         movl    1096(%edi,%ebx,4),%ebp
193         movb    %dh,            %al
194         movb    %dl,            %bl
195         addl    %ebp,           %esi
196         movl    2120(%edi,%eax,4),%eax
197         xorl    %eax,           %esi
198         movl    3144(%edi,%ebx,4),%ebp
199         addl    %ebp,           %esi
200         xorl    %eax,           %eax
201         xorl    %esi,           %ecx
202
203         /* Round 6 */
204         rorl    $16,            %ecx
205         movl    28(%edi),       %esi
206         movb    %ch,            %al
207         movb    %cl,            %bl
208         rorl    $16,            %ecx
209         xorl    %esi,           %edx
210         movl    72(%edi,%eax,4),%esi
211         movl    1096(%edi,%ebx,4),%ebp
212         movb    %ch,            %al
213         movb    %cl,            %bl
214         addl    %ebp,           %esi
215         movl    2120(%edi,%eax,4),%eax
216         xorl    %eax,           %esi
217         movl    3144(%edi,%ebx,4),%ebp
218         addl    %ebp,           %esi
219         xorl    %eax,           %eax
220         xorl    %esi,           %edx
221
222         /* Round 7 */
223         rorl    $16,            %edx
224         movl    32(%edi),       %esi
225         movb    %dh,            %al
226         movb    %dl,            %bl
227         rorl    $16,            %edx
228         xorl    %esi,           %ecx
229         movl    72(%edi,%eax,4),%esi
230         movl    1096(%edi,%ebx,4),%ebp
231         movb    %dh,            %al
232         movb    %dl,            %bl
233         addl    %ebp,           %esi
234         movl    2120(%edi,%eax,4),%eax
235         xorl    %eax,           %esi
236         movl    3144(%edi,%ebx,4),%ebp
237         addl    %ebp,           %esi
238         xorl    %eax,           %eax
239         xorl    %esi,           %ecx
240
241         /* Round 8 */
242         rorl    $16,            %ecx
243         movl    36(%edi),       %esi
244         movb    %ch,            %al
245         movb    %cl,            %bl
246         rorl    $16,            %ecx
247         xorl    %esi,           %edx
248         movl    72(%edi,%eax,4),%esi
249         movl    1096(%edi,%ebx,4),%ebp
250         movb    %ch,            %al
251         movb    %cl,            %bl
252         addl    %ebp,           %esi
253         movl    2120(%edi,%eax,4),%eax
254         xorl    %eax,           %esi
255         movl    3144(%edi,%ebx,4),%ebp
256         addl    %ebp,           %esi
257         xorl    %eax,           %eax
258         xorl    %esi,           %edx
259
260         /* Round 9 */
261         rorl    $16,            %edx
262         movl    40(%edi),       %esi
263         movb    %dh,            %al
264         movb    %dl,            %bl
265         rorl    $16,            %edx
266         xorl    %esi,           %ecx
267         movl    72(%edi,%eax,4),%esi
268         movl    1096(%edi,%ebx,4),%ebp
269         movb    %dh,            %al
270         movb    %dl,            %bl
271         addl    %ebp,           %esi
272         movl    2120(%edi,%eax,4),%eax
273         xorl    %eax,           %esi
274         movl    3144(%edi,%ebx,4),%ebp
275         addl    %ebp,           %esi
276         xorl    %eax,           %eax
277         xorl    %esi,           %ecx
278
279         /* Round 10 */
280         rorl    $16,            %ecx
281         movl    44(%edi),       %esi
282         movb    %ch,            %al
283         movb    %cl,            %bl
284         rorl    $16,            %ecx
285         xorl    %esi,           %edx
286         movl    72(%edi,%eax,4),%esi
287         movl    1096(%edi,%ebx,4),%ebp
288         movb    %ch,            %al
289         movb    %cl,            %bl
290         addl    %ebp,           %esi
291         movl    2120(%edi,%eax,4),%eax
292         xorl    %eax,           %esi
293         movl    3144(%edi,%ebx,4),%ebp
294         addl    %ebp,           %esi
295         xorl    %eax,           %eax
296         xorl    %esi,           %edx
297
298         /* Round 11 */
299         rorl    $16,            %edx
300         movl    48(%edi),       %esi
301         movb    %dh,            %al
302         movb    %dl,            %bl
303         rorl    $16,            %edx
304         xorl    %esi,           %ecx
305         movl    72(%edi,%eax,4),%esi
306         movl    1096(%edi,%ebx,4),%ebp
307         movb    %dh,            %al
308         movb    %dl,            %bl
309         addl    %ebp,           %esi
310         movl    2120(%edi,%eax,4),%eax
311         xorl    %eax,           %esi
312         movl    3144(%edi,%ebx,4),%ebp
313         addl    %ebp,           %esi
314         xorl    %eax,           %eax
315         xorl    %esi,           %ecx
316
317         /* Round 12 */
318         rorl    $16,            %ecx
319         movl    52(%edi),       %esi
320         movb    %ch,            %al
321         movb    %cl,            %bl
322         rorl    $16,            %ecx
323         xorl    %esi,           %edx
324         movl    72(%edi,%eax,4),%esi
325         movl    1096(%edi,%ebx,4),%ebp
326         movb    %ch,            %al
327         movb    %cl,            %bl
328         addl    %ebp,           %esi
329         movl    2120(%edi,%eax,4),%eax
330         xorl    %eax,           %esi
331         movl    3144(%edi,%ebx,4),%ebp
332         addl    %ebp,           %esi
333         xorl    %eax,           %eax
334         xorl    %esi,           %edx
335
336         /* Round 13 */
337         rorl    $16,            %edx
338         movl    56(%edi),       %esi
339         movb    %dh,            %al
340         movb    %dl,            %bl
341         rorl    $16,            %edx
342         xorl    %esi,           %ecx
343         movl    72(%edi,%eax,4),%esi
344         movl    1096(%edi,%ebx,4),%ebp
345         movb    %dh,            %al
346         movb    %dl,            %bl
347         addl    %ebp,           %esi
348         movl    2120(%edi,%eax,4),%eax
349         xorl    %eax,           %esi
350         movl    3144(%edi,%ebx,4),%ebp
351         addl    %ebp,           %esi
352         xorl    %eax,           %eax
353         xorl    %esi,           %ecx
354
355         /* Round 14 */
356         rorl    $16,            %ecx
357         movl    60(%edi),       %esi
358         movb    %ch,            %al
359         movb    %cl,            %bl
360         rorl    $16,            %ecx
361         xorl    %esi,           %edx
362         movl    72(%edi,%eax,4),%esi
363         movl    1096(%edi,%ebx,4),%ebp
364         movb    %ch,            %al
365         movb    %cl,            %bl
366         addl    %ebp,           %esi
367         movl    2120(%edi,%eax,4),%eax
368         xorl    %eax,           %esi
369         movl    3144(%edi,%ebx,4),%ebp
370         addl    %ebp,           %esi
371         xorl    %eax,           %eax
372         xorl    %esi,           %edx
373
374         /* Round 15 */
375         rorl    $16,            %edx
376         movl    64(%edi),       %esi
377         movb    %dh,            %al
378         movb    %dl,            %bl
379         rorl    $16,            %edx
380         xorl    %esi,           %ecx
381         movl    72(%edi,%eax,4),%esi
382         movl    1096(%edi,%ebx,4),%ebp
383         movb    %dh,            %al
384         movb    %dl,            %bl
385         addl    %ebp,           %esi
386         movl    2120(%edi,%eax,4),%eax
387         xorl    %eax,           %esi
388         movl    3144(%edi,%ebx,4),%ebp
389         addl    %ebp,           %esi
390         xorl    %eax,           %eax
391         xorl    %esi,           %ecx
392         xorl    68(%edi),       %edx
393         movl    20(%esp),       %eax
394         movl    %edx,           (%eax)
395         movl    %ecx,           4(%eax)
396         popl    %edi
397         popl    %esi
398         popl    %ebx
399         popl    %ebp
400         ret
401 .L_BF_encrypt_end:
402         .size   _C_LABEL(BF_encrypt),.L_BF_encrypt_end-_C_LABEL(BF_encrypt)
403
404 ENTRY(BF_decrypt)
405         pushl   %ebp
406         pushl   %ebx
407         pushl   %esi
408         pushl   %edi
409
410
411         /* Load the 2 words */
412         movl    20(%esp),       %eax
413         movl    (%eax),         %ecx
414         movl    4(%eax),        %edx
415
416         /* P pointer, s and enc flag */
417         movl    24(%esp),       %edi
418         xorl    %eax,           %eax
419         xorl    %ebx,           %ebx
420         xorl    68(%edi),       %ecx
421
422         /* Round 16 */
423         rorl    $16,            %ecx
424         movl    64(%edi),       %esi
425         movb    %ch,            %al
426         movb    %cl,            %bl
427         rorl    $16,            %ecx
428         xorl    %esi,           %edx
429         movl    72(%edi,%eax,4),%esi
430         movl    1096(%edi,%ebx,4),%ebp
431         movb    %ch,            %al
432         movb    %cl,            %bl
433         addl    %ebp,           %esi
434         movl    2120(%edi,%eax,4),%eax
435         xorl    %eax,           %esi
436         movl    3144(%edi,%ebx,4),%ebp
437         addl    %ebp,           %esi
438         xorl    %eax,           %eax
439         xorl    %esi,           %edx
440
441         /* Round 15 */
442         rorl    $16,            %edx
443         movl    60(%edi),       %esi
444         movb    %dh,            %al
445         movb    %dl,            %bl
446         rorl    $16,            %edx
447         xorl    %esi,           %ecx
448         movl    72(%edi,%eax,4),%esi
449         movl    1096(%edi,%ebx,4),%ebp
450         movb    %dh,            %al
451         movb    %dl,            %bl
452         addl    %ebp,           %esi
453         movl    2120(%edi,%eax,4),%eax
454         xorl    %eax,           %esi
455         movl    3144(%edi,%ebx,4),%ebp
456         addl    %ebp,           %esi
457         xorl    %eax,           %eax
458         xorl    %esi,           %ecx
459
460         /* Round 14 */
461         rorl    $16,            %ecx
462         movl    56(%edi),       %esi
463         movb    %ch,            %al
464         movb    %cl,            %bl
465         rorl    $16,            %ecx
466         xorl    %esi,           %edx
467         movl    72(%edi,%eax,4),%esi
468         movl    1096(%edi,%ebx,4),%ebp
469         movb    %ch,            %al
470         movb    %cl,            %bl
471         addl    %ebp,           %esi
472         movl    2120(%edi,%eax,4),%eax
473         xorl    %eax,           %esi
474         movl    3144(%edi,%ebx,4),%ebp
475         addl    %ebp,           %esi
476         xorl    %eax,           %eax
477         xorl    %esi,           %edx
478
479         /* Round 13 */
480         rorl    $16,            %edx
481         movl    52(%edi),       %esi
482         movb    %dh,            %al
483         movb    %dl,            %bl
484         rorl    $16,            %edx
485         xorl    %esi,           %ecx
486         movl    72(%edi,%eax,4),%esi
487         movl    1096(%edi,%ebx,4),%ebp
488         movb    %dh,            %al
489         movb    %dl,            %bl
490         addl    %ebp,           %esi
491         movl    2120(%edi,%eax,4),%eax
492         xorl    %eax,           %esi
493         movl    3144(%edi,%ebx,4),%ebp
494         addl    %ebp,           %esi
495         xorl    %eax,           %eax
496         xorl    %esi,           %ecx
497
498         /* Round 12 */
499         rorl    $16,            %ecx
500         movl    48(%edi),       %esi
501         movb    %ch,            %al
502         movb    %cl,            %bl
503         rorl    $16,            %ecx
504         xorl    %esi,           %edx
505         movl    72(%edi,%eax,4),%esi
506         movl    1096(%edi,%ebx,4),%ebp
507         movb    %ch,            %al
508         movb    %cl,            %bl
509         addl    %ebp,           %esi
510         movl    2120(%edi,%eax,4),%eax
511         xorl    %eax,           %esi
512         movl    3144(%edi,%ebx,4),%ebp
513         addl    %ebp,           %esi
514         xorl    %eax,           %eax
515         xorl    %esi,           %edx
516
517         /* Round 11 */
518         rorl    $16,            %edx
519         movl    44(%edi),       %esi
520         movb    %dh,            %al
521         movb    %dl,            %bl
522         rorl    $16,            %edx
523         xorl    %esi,           %ecx
524         movl    72(%edi,%eax,4),%esi
525         movl    1096(%edi,%ebx,4),%ebp
526         movb    %dh,            %al
527         movb    %dl,            %bl
528         addl    %ebp,           %esi
529         movl    2120(%edi,%eax,4),%eax
530         xorl    %eax,           %esi
531         movl    3144(%edi,%ebx,4),%ebp
532         addl    %ebp,           %esi
533         xorl    %eax,           %eax
534         xorl    %esi,           %ecx
535
536         /* Round 10 */
537         rorl    $16,            %ecx
538         movl    40(%edi),       %esi
539         movb    %ch,            %al
540         movb    %cl,            %bl
541         rorl    $16,            %ecx
542         xorl    %esi,           %edx
543         movl    72(%edi,%eax,4),%esi
544         movl    1096(%edi,%ebx,4),%ebp
545         movb    %ch,            %al
546         movb    %cl,            %bl
547         addl    %ebp,           %esi
548         movl    2120(%edi,%eax,4),%eax
549         xorl    %eax,           %esi
550         movl    3144(%edi,%ebx,4),%ebp
551         addl    %ebp,           %esi
552         xorl    %eax,           %eax
553         xorl    %esi,           %edx
554
555         /* Round 9 */
556         rorl    $16,            %edx
557         movl    36(%edi),       %esi
558         movb    %dh,            %al
559         movb    %dl,            %bl
560         rorl    $16,            %edx
561         xorl    %esi,           %ecx
562         movl    72(%edi,%eax,4),%esi
563         movl    1096(%edi,%ebx,4),%ebp
564         movb    %dh,            %al
565         movb    %dl,            %bl
566         addl    %ebp,           %esi
567         movl    2120(%edi,%eax,4),%eax
568         xorl    %eax,           %esi
569         movl    3144(%edi,%ebx,4),%ebp
570         addl    %ebp,           %esi
571         xorl    %eax,           %eax
572         xorl    %esi,           %ecx
573
574         /* Round 8 */
575         rorl    $16,            %ecx
576         movl    32(%edi),       %esi
577         movb    %ch,            %al
578         movb    %cl,            %bl
579         rorl    $16,            %ecx
580         xorl    %esi,           %edx
581         movl    72(%edi,%eax,4),%esi
582         movl    1096(%edi,%ebx,4),%ebp
583         movb    %ch,            %al
584         movb    %cl,            %bl
585         addl    %ebp,           %esi
586         movl    2120(%edi,%eax,4),%eax
587         xorl    %eax,           %esi
588         movl    3144(%edi,%ebx,4),%ebp
589         addl    %ebp,           %esi
590         xorl    %eax,           %eax
591         xorl    %esi,           %edx
592
593         /* Round 7 */
594         rorl    $16,            %edx
595         movl    28(%edi),       %esi
596         movb    %dh,            %al
597         movb    %dl,            %bl
598         rorl    $16,            %edx
599         xorl    %esi,           %ecx
600         movl    72(%edi,%eax,4),%esi
601         movl    1096(%edi,%ebx,4),%ebp
602         movb    %dh,            %al
603         movb    %dl,            %bl
604         addl    %ebp,           %esi
605         movl    2120(%edi,%eax,4),%eax
606         xorl    %eax,           %esi
607         movl    3144(%edi,%ebx,4),%ebp
608         addl    %ebp,           %esi
609         xorl    %eax,           %eax
610         xorl    %esi,           %ecx
611
612         /* Round 6 */
613         rorl    $16,            %ecx
614         movl    24(%edi),       %esi
615         movb    %ch,            %al
616         movb    %cl,            %bl
617         rorl    $16,            %ecx
618         xorl    %esi,           %edx
619         movl    72(%edi,%eax,4),%esi
620         movl    1096(%edi,%ebx,4),%ebp
621         movb    %ch,            %al
622         movb    %cl,            %bl
623         addl    %ebp,           %esi
624         movl    2120(%edi,%eax,4),%eax
625         xorl    %eax,           %esi
626         movl    3144(%edi,%ebx,4),%ebp
627         addl    %ebp,           %esi
628         xorl    %eax,           %eax
629         xorl    %esi,           %edx
630
631         /* Round 5 */
632         rorl    $16,            %edx
633         movl    20(%edi),       %esi
634         movb    %dh,            %al
635         movb    %dl,            %bl
636         rorl    $16,            %edx
637         xorl    %esi,           %ecx
638         movl    72(%edi,%eax,4),%esi
639         movl    1096(%edi,%ebx,4),%ebp
640         movb    %dh,            %al
641         movb    %dl,            %bl
642         addl    %ebp,           %esi
643         movl    2120(%edi,%eax,4),%eax
644         xorl    %eax,           %esi
645         movl    3144(%edi,%ebx,4),%ebp
646         addl    %ebp,           %esi
647         xorl    %eax,           %eax
648         xorl    %esi,           %ecx
649
650         /* Round 4 */
651         rorl    $16,            %ecx
652         movl    16(%edi),       %esi
653         movb    %ch,            %al
654         movb    %cl,            %bl
655         rorl    $16,            %ecx
656         xorl    %esi,           %edx
657         movl    72(%edi,%eax,4),%esi
658         movl    1096(%edi,%ebx,4),%ebp
659         movb    %ch,            %al
660         movb    %cl,            %bl
661         addl    %ebp,           %esi
662         movl    2120(%edi,%eax,4),%eax
663         xorl    %eax,           %esi
664         movl    3144(%edi,%ebx,4),%ebp
665         addl    %ebp,           %esi
666         xorl    %eax,           %eax
667         xorl    %esi,           %edx
668
669         /* Round 3 */
670         rorl    $16,            %edx
671         movl    12(%edi),       %esi
672         movb    %dh,            %al
673         movb    %dl,            %bl
674         rorl    $16,            %edx
675         xorl    %esi,           %ecx
676         movl    72(%edi,%eax,4),%esi
677         movl    1096(%edi,%ebx,4),%ebp
678         movb    %dh,            %al
679         movb    %dl,            %bl
680         addl    %ebp,           %esi
681         movl    2120(%edi,%eax,4),%eax
682         xorl    %eax,           %esi
683         movl    3144(%edi,%ebx,4),%ebp
684         addl    %ebp,           %esi
685         xorl    %eax,           %eax
686         xorl    %esi,           %ecx
687
688         /* Round 2 */
689         rorl    $16,            %ecx
690         movl    8(%edi),        %esi
691         movb    %ch,            %al
692         movb    %cl,            %bl
693         rorl    $16,            %ecx
694         xorl    %esi,           %edx
695         movl    72(%edi,%eax,4),%esi
696         movl    1096(%edi,%ebx,4),%ebp
697         movb    %ch,            %al
698         movb    %cl,            %bl
699         addl    %ebp,           %esi
700         movl    2120(%edi,%eax,4),%eax
701         xorl    %eax,           %esi
702         movl    3144(%edi,%ebx,4),%ebp
703         addl    %ebp,           %esi
704         xorl    %eax,           %eax
705         xorl    %esi,           %edx
706
707         /* Round 1 */
708         rorl    $16,            %edx
709         movl    4(%edi),        %esi
710         movb    %dh,            %al
711         movb    %dl,            %bl
712         rorl    $16,            %edx
713         xorl    %esi,           %ecx
714         movl    72(%edi,%eax,4),%esi
715         movl    1096(%edi,%ebx,4),%ebp
716         movb    %dh,            %al
717         movb    %dl,            %bl
718         addl    %ebp,           %esi
719         movl    2120(%edi,%eax,4),%eax
720         xorl    %eax,           %esi
721         movl    3144(%edi,%ebx,4),%ebp
722         addl    %ebp,           %esi
723         xorl    %eax,           %eax
724         xorl    %esi,           %ecx
725         xorl    (%edi),         %edx
726         movl    20(%esp),       %eax
727         movl    %edx,           (%eax)
728         movl    %ecx,           4(%eax)
729         popl    %edi
730         popl    %esi
731         popl    %ebx
732         popl    %ebp
733         ret
734         .L_BF_decrypt_end:
735         .size   _C_LABEL(BF_decrypt),.L_BF_decrypt_end-_C_LABEL(BF_decrypt)