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