bf_enc_686.S revision 1.5 1 /* $NetBSD: bf_enc_686.S,v 1.5 2007/12/11 23:13:57 lukem 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-686.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 __KERNEL_RCSID(1, "$NetBSD: bf_enc_686.S,v 1.5 2007/12/11 23:13:57 lukem Exp $");
68
69 ENTRY(BF_encrypt)
70 pushl %ebp
71 pushl %ebx
72 pushl %esi
73 pushl %edi
74
75
76 /* Load the 2 words */
77 movl 20(%esp), %eax
78 movl (%eax), %ecx
79 movl 4(%eax), %edx
80
81 /* P pointer, s and enc flag */
82 movl 24(%esp), %edi
83 xorl %eax, %eax
84 xorl %ebx, %ebx
85 xorl (%edi), %ecx
86
87 /* Round 0 */
88 rorl $16, %ecx
89 movl 4(%edi), %esi
90 movb %ch, %al
91 movb %cl, %bl
92 rorl $16, %ecx
93 xorl %esi, %edx
94 movl 72(%edi,%eax,4),%esi
95 movl 1096(%edi,%ebx,4),%ebp
96 movb %ch, %al
97 movb %cl, %bl
98 addl %ebp, %esi
99 movl 2120(%edi,%eax,4),%eax
100 xorl %eax, %esi
101 movl 3144(%edi,%ebx,4),%ebp
102 addl %ebp, %esi
103 xorl %eax, %eax
104 xorl %esi, %edx
105
106 /* Round 1 */
107 rorl $16, %edx
108 movl 8(%edi), %esi
109 movb %dh, %al
110 movb %dl, %bl
111 rorl $16, %edx
112 xorl %esi, %ecx
113 movl 72(%edi,%eax,4),%esi
114 movl 1096(%edi,%ebx,4),%ebp
115 movb %dh, %al
116 movb %dl, %bl
117 addl %ebp, %esi
118 movl 2120(%edi,%eax,4),%eax
119 xorl %eax, %esi
120 movl 3144(%edi,%ebx,4),%ebp
121 addl %ebp, %esi
122 xorl %eax, %eax
123 xorl %esi, %ecx
124
125 /* Round 2 */
126 rorl $16, %ecx
127 movl 12(%edi), %esi
128 movb %ch, %al
129 movb %cl, %bl
130 rorl $16, %ecx
131 xorl %esi, %edx
132 movl 72(%edi,%eax,4),%esi
133 movl 1096(%edi,%ebx,4),%ebp
134 movb %ch, %al
135 movb %cl, %bl
136 addl %ebp, %esi
137 movl 2120(%edi,%eax,4),%eax
138 xorl %eax, %esi
139 movl 3144(%edi,%ebx,4),%ebp
140 addl %ebp, %esi
141 xorl %eax, %eax
142 xorl %esi, %edx
143
144 /* Round 3 */
145 rorl $16, %edx
146 movl 16(%edi), %esi
147 movb %dh, %al
148 movb %dl, %bl
149 rorl $16, %edx
150 xorl %esi, %ecx
151 movl 72(%edi,%eax,4),%esi
152 movl 1096(%edi,%ebx,4),%ebp
153 movb %dh, %al
154 movb %dl, %bl
155 addl %ebp, %esi
156 movl 2120(%edi,%eax,4),%eax
157 xorl %eax, %esi
158 movl 3144(%edi,%ebx,4),%ebp
159 addl %ebp, %esi
160 xorl %eax, %eax
161 xorl %esi, %ecx
162
163 /* Round 4 */
164 rorl $16, %ecx
165 movl 20(%edi), %esi
166 movb %ch, %al
167 movb %cl, %bl
168 rorl $16, %ecx
169 xorl %esi, %edx
170 movl 72(%edi,%eax,4),%esi
171 movl 1096(%edi,%ebx,4),%ebp
172 movb %ch, %al
173 movb %cl, %bl
174 addl %ebp, %esi
175 movl 2120(%edi,%eax,4),%eax
176 xorl %eax, %esi
177 movl 3144(%edi,%ebx,4),%ebp
178 addl %ebp, %esi
179 xorl %eax, %eax
180 xorl %esi, %edx
181
182 /* Round 5 */
183 rorl $16, %edx
184 movl 24(%edi), %esi
185 movb %dh, %al
186 movb %dl, %bl
187 rorl $16, %edx
188 xorl %esi, %ecx
189 movl 72(%edi,%eax,4),%esi
190 movl 1096(%edi,%ebx,4),%ebp
191 movb %dh, %al
192 movb %dl, %bl
193 addl %ebp, %esi
194 movl 2120(%edi,%eax,4),%eax
195 xorl %eax, %esi
196 movl 3144(%edi,%ebx,4),%ebp
197 addl %ebp, %esi
198 xorl %eax, %eax
199 xorl %esi, %ecx
200
201 /* Round 6 */
202 rorl $16, %ecx
203 movl 28(%edi), %esi
204 movb %ch, %al
205 movb %cl, %bl
206 rorl $16, %ecx
207 xorl %esi, %edx
208 movl 72(%edi,%eax,4),%esi
209 movl 1096(%edi,%ebx,4),%ebp
210 movb %ch, %al
211 movb %cl, %bl
212 addl %ebp, %esi
213 movl 2120(%edi,%eax,4),%eax
214 xorl %eax, %esi
215 movl 3144(%edi,%ebx,4),%ebp
216 addl %ebp, %esi
217 xorl %eax, %eax
218 xorl %esi, %edx
219
220 /* Round 7 */
221 rorl $16, %edx
222 movl 32(%edi), %esi
223 movb %dh, %al
224 movb %dl, %bl
225 rorl $16, %edx
226 xorl %esi, %ecx
227 movl 72(%edi,%eax,4),%esi
228 movl 1096(%edi,%ebx,4),%ebp
229 movb %dh, %al
230 movb %dl, %bl
231 addl %ebp, %esi
232 movl 2120(%edi,%eax,4),%eax
233 xorl %eax, %esi
234 movl 3144(%edi,%ebx,4),%ebp
235 addl %ebp, %esi
236 xorl %eax, %eax
237 xorl %esi, %ecx
238
239 /* Round 8 */
240 rorl $16, %ecx
241 movl 36(%edi), %esi
242 movb %ch, %al
243 movb %cl, %bl
244 rorl $16, %ecx
245 xorl %esi, %edx
246 movl 72(%edi,%eax,4),%esi
247 movl 1096(%edi,%ebx,4),%ebp
248 movb %ch, %al
249 movb %cl, %bl
250 addl %ebp, %esi
251 movl 2120(%edi,%eax,4),%eax
252 xorl %eax, %esi
253 movl 3144(%edi,%ebx,4),%ebp
254 addl %ebp, %esi
255 xorl %eax, %eax
256 xorl %esi, %edx
257
258 /* Round 9 */
259 rorl $16, %edx
260 movl 40(%edi), %esi
261 movb %dh, %al
262 movb %dl, %bl
263 rorl $16, %edx
264 xorl %esi, %ecx
265 movl 72(%edi,%eax,4),%esi
266 movl 1096(%edi,%ebx,4),%ebp
267 movb %dh, %al
268 movb %dl, %bl
269 addl %ebp, %esi
270 movl 2120(%edi,%eax,4),%eax
271 xorl %eax, %esi
272 movl 3144(%edi,%ebx,4),%ebp
273 addl %ebp, %esi
274 xorl %eax, %eax
275 xorl %esi, %ecx
276
277 /* Round 10 */
278 rorl $16, %ecx
279 movl 44(%edi), %esi
280 movb %ch, %al
281 movb %cl, %bl
282 rorl $16, %ecx
283 xorl %esi, %edx
284 movl 72(%edi,%eax,4),%esi
285 movl 1096(%edi,%ebx,4),%ebp
286 movb %ch, %al
287 movb %cl, %bl
288 addl %ebp, %esi
289 movl 2120(%edi,%eax,4),%eax
290 xorl %eax, %esi
291 movl 3144(%edi,%ebx,4),%ebp
292 addl %ebp, %esi
293 xorl %eax, %eax
294 xorl %esi, %edx
295
296 /* Round 11 */
297 rorl $16, %edx
298 movl 48(%edi), %esi
299 movb %dh, %al
300 movb %dl, %bl
301 rorl $16, %edx
302 xorl %esi, %ecx
303 movl 72(%edi,%eax,4),%esi
304 movl 1096(%edi,%ebx,4),%ebp
305 movb %dh, %al
306 movb %dl, %bl
307 addl %ebp, %esi
308 movl 2120(%edi,%eax,4),%eax
309 xorl %eax, %esi
310 movl 3144(%edi,%ebx,4),%ebp
311 addl %ebp, %esi
312 xorl %eax, %eax
313 xorl %esi, %ecx
314
315 /* Round 12 */
316 rorl $16, %ecx
317 movl 52(%edi), %esi
318 movb %ch, %al
319 movb %cl, %bl
320 rorl $16, %ecx
321 xorl %esi, %edx
322 movl 72(%edi,%eax,4),%esi
323 movl 1096(%edi,%ebx,4),%ebp
324 movb %ch, %al
325 movb %cl, %bl
326 addl %ebp, %esi
327 movl 2120(%edi,%eax,4),%eax
328 xorl %eax, %esi
329 movl 3144(%edi,%ebx,4),%ebp
330 addl %ebp, %esi
331 xorl %eax, %eax
332 xorl %esi, %edx
333
334 /* Round 13 */
335 rorl $16, %edx
336 movl 56(%edi), %esi
337 movb %dh, %al
338 movb %dl, %bl
339 rorl $16, %edx
340 xorl %esi, %ecx
341 movl 72(%edi,%eax,4),%esi
342 movl 1096(%edi,%ebx,4),%ebp
343 movb %dh, %al
344 movb %dl, %bl
345 addl %ebp, %esi
346 movl 2120(%edi,%eax,4),%eax
347 xorl %eax, %esi
348 movl 3144(%edi,%ebx,4),%ebp
349 addl %ebp, %esi
350 xorl %eax, %eax
351 xorl %esi, %ecx
352
353 /* Round 14 */
354 rorl $16, %ecx
355 movl 60(%edi), %esi
356 movb %ch, %al
357 movb %cl, %bl
358 rorl $16, %ecx
359 xorl %esi, %edx
360 movl 72(%edi,%eax,4),%esi
361 movl 1096(%edi,%ebx,4),%ebp
362 movb %ch, %al
363 movb %cl, %bl
364 addl %ebp, %esi
365 movl 2120(%edi,%eax,4),%eax
366 xorl %eax, %esi
367 movl 3144(%edi,%ebx,4),%ebp
368 addl %ebp, %esi
369 xorl %eax, %eax
370 xorl %esi, %edx
371
372 /* Round 15 */
373 rorl $16, %edx
374 movl 64(%edi), %esi
375 movb %dh, %al
376 movb %dl, %bl
377 rorl $16, %edx
378 xorl %esi, %ecx
379 movl 72(%edi,%eax,4),%esi
380 movl 1096(%edi,%ebx,4),%ebp
381 movb %dh, %al
382 movb %dl, %bl
383 addl %ebp, %esi
384 movl 2120(%edi,%eax,4),%eax
385 xorl %eax, %esi
386 movl 3144(%edi,%ebx,4),%ebp
387 addl %ebp, %esi
388 xorl %eax, %eax
389 xorl %esi, %ecx
390 xorl 68(%edi), %edx
391 movl 20(%esp), %eax
392 movl %edx, (%eax)
393 movl %ecx, 4(%eax)
394 popl %edi
395 popl %esi
396 popl %ebx
397 popl %ebp
398 ret
399 .L_BF_encrypt_end:
400 .size _C_LABEL(BF_encrypt),.L_BF_encrypt_end-_C_LABEL(BF_encrypt)
401
402 ENTRY(BF_decrypt)
403 pushl %ebp
404 pushl %ebx
405 pushl %esi
406 pushl %edi
407
408
409 /* Load the 2 words */
410 movl 20(%esp), %eax
411 movl (%eax), %ecx
412 movl 4(%eax), %edx
413
414 /* P pointer, s and enc flag */
415 movl 24(%esp), %edi
416 xorl %eax, %eax
417 xorl %ebx, %ebx
418 xorl 68(%edi), %ecx
419
420 /* Round 16 */
421 rorl $16, %ecx
422 movl 64(%edi), %esi
423 movb %ch, %al
424 movb %cl, %bl
425 rorl $16, %ecx
426 xorl %esi, %edx
427 movl 72(%edi,%eax,4),%esi
428 movl 1096(%edi,%ebx,4),%ebp
429 movb %ch, %al
430 movb %cl, %bl
431 addl %ebp, %esi
432 movl 2120(%edi,%eax,4),%eax
433 xorl %eax, %esi
434 movl 3144(%edi,%ebx,4),%ebp
435 addl %ebp, %esi
436 xorl %eax, %eax
437 xorl %esi, %edx
438
439 /* Round 15 */
440 rorl $16, %edx
441 movl 60(%edi), %esi
442 movb %dh, %al
443 movb %dl, %bl
444 rorl $16, %edx
445 xorl %esi, %ecx
446 movl 72(%edi,%eax,4),%esi
447 movl 1096(%edi,%ebx,4),%ebp
448 movb %dh, %al
449 movb %dl, %bl
450 addl %ebp, %esi
451 movl 2120(%edi,%eax,4),%eax
452 xorl %eax, %esi
453 movl 3144(%edi,%ebx,4),%ebp
454 addl %ebp, %esi
455 xorl %eax, %eax
456 xorl %esi, %ecx
457
458 /* Round 14 */
459 rorl $16, %ecx
460 movl 56(%edi), %esi
461 movb %ch, %al
462 movb %cl, %bl
463 rorl $16, %ecx
464 xorl %esi, %edx
465 movl 72(%edi,%eax,4),%esi
466 movl 1096(%edi,%ebx,4),%ebp
467 movb %ch, %al
468 movb %cl, %bl
469 addl %ebp, %esi
470 movl 2120(%edi,%eax,4),%eax
471 xorl %eax, %esi
472 movl 3144(%edi,%ebx,4),%ebp
473 addl %ebp, %esi
474 xorl %eax, %eax
475 xorl %esi, %edx
476
477 /* Round 13 */
478 rorl $16, %edx
479 movl 52(%edi), %esi
480 movb %dh, %al
481 movb %dl, %bl
482 rorl $16, %edx
483 xorl %esi, %ecx
484 movl 72(%edi,%eax,4),%esi
485 movl 1096(%edi,%ebx,4),%ebp
486 movb %dh, %al
487 movb %dl, %bl
488 addl %ebp, %esi
489 movl 2120(%edi,%eax,4),%eax
490 xorl %eax, %esi
491 movl 3144(%edi,%ebx,4),%ebp
492 addl %ebp, %esi
493 xorl %eax, %eax
494 xorl %esi, %ecx
495
496 /* Round 12 */
497 rorl $16, %ecx
498 movl 48(%edi), %esi
499 movb %ch, %al
500 movb %cl, %bl
501 rorl $16, %ecx
502 xorl %esi, %edx
503 movl 72(%edi,%eax,4),%esi
504 movl 1096(%edi,%ebx,4),%ebp
505 movb %ch, %al
506 movb %cl, %bl
507 addl %ebp, %esi
508 movl 2120(%edi,%eax,4),%eax
509 xorl %eax, %esi
510 movl 3144(%edi,%ebx,4),%ebp
511 addl %ebp, %esi
512 xorl %eax, %eax
513 xorl %esi, %edx
514
515 /* Round 11 */
516 rorl $16, %edx
517 movl 44(%edi), %esi
518 movb %dh, %al
519 movb %dl, %bl
520 rorl $16, %edx
521 xorl %esi, %ecx
522 movl 72(%edi,%eax,4),%esi
523 movl 1096(%edi,%ebx,4),%ebp
524 movb %dh, %al
525 movb %dl, %bl
526 addl %ebp, %esi
527 movl 2120(%edi,%eax,4),%eax
528 xorl %eax, %esi
529 movl 3144(%edi,%ebx,4),%ebp
530 addl %ebp, %esi
531 xorl %eax, %eax
532 xorl %esi, %ecx
533
534 /* Round 10 */
535 rorl $16, %ecx
536 movl 40(%edi), %esi
537 movb %ch, %al
538 movb %cl, %bl
539 rorl $16, %ecx
540 xorl %esi, %edx
541 movl 72(%edi,%eax,4),%esi
542 movl 1096(%edi,%ebx,4),%ebp
543 movb %ch, %al
544 movb %cl, %bl
545 addl %ebp, %esi
546 movl 2120(%edi,%eax,4),%eax
547 xorl %eax, %esi
548 movl 3144(%edi,%ebx,4),%ebp
549 addl %ebp, %esi
550 xorl %eax, %eax
551 xorl %esi, %edx
552
553 /* Round 9 */
554 rorl $16, %edx
555 movl 36(%edi), %esi
556 movb %dh, %al
557 movb %dl, %bl
558 rorl $16, %edx
559 xorl %esi, %ecx
560 movl 72(%edi,%eax,4),%esi
561 movl 1096(%edi,%ebx,4),%ebp
562 movb %dh, %al
563 movb %dl, %bl
564 addl %ebp, %esi
565 movl 2120(%edi,%eax,4),%eax
566 xorl %eax, %esi
567 movl 3144(%edi,%ebx,4),%ebp
568 addl %ebp, %esi
569 xorl %eax, %eax
570 xorl %esi, %ecx
571
572 /* Round 8 */
573 rorl $16, %ecx
574 movl 32(%edi), %esi
575 movb %ch, %al
576 movb %cl, %bl
577 rorl $16, %ecx
578 xorl %esi, %edx
579 movl 72(%edi,%eax,4),%esi
580 movl 1096(%edi,%ebx,4),%ebp
581 movb %ch, %al
582 movb %cl, %bl
583 addl %ebp, %esi
584 movl 2120(%edi,%eax,4),%eax
585 xorl %eax, %esi
586 movl 3144(%edi,%ebx,4),%ebp
587 addl %ebp, %esi
588 xorl %eax, %eax
589 xorl %esi, %edx
590
591 /* Round 7 */
592 rorl $16, %edx
593 movl 28(%edi), %esi
594 movb %dh, %al
595 movb %dl, %bl
596 rorl $16, %edx
597 xorl %esi, %ecx
598 movl 72(%edi,%eax,4),%esi
599 movl 1096(%edi,%ebx,4),%ebp
600 movb %dh, %al
601 movb %dl, %bl
602 addl %ebp, %esi
603 movl 2120(%edi,%eax,4),%eax
604 xorl %eax, %esi
605 movl 3144(%edi,%ebx,4),%ebp
606 addl %ebp, %esi
607 xorl %eax, %eax
608 xorl %esi, %ecx
609
610 /* Round 6 */
611 rorl $16, %ecx
612 movl 24(%edi), %esi
613 movb %ch, %al
614 movb %cl, %bl
615 rorl $16, %ecx
616 xorl %esi, %edx
617 movl 72(%edi,%eax,4),%esi
618 movl 1096(%edi,%ebx,4),%ebp
619 movb %ch, %al
620 movb %cl, %bl
621 addl %ebp, %esi
622 movl 2120(%edi,%eax,4),%eax
623 xorl %eax, %esi
624 movl 3144(%edi,%ebx,4),%ebp
625 addl %ebp, %esi
626 xorl %eax, %eax
627 xorl %esi, %edx
628
629 /* Round 5 */
630 rorl $16, %edx
631 movl 20(%edi), %esi
632 movb %dh, %al
633 movb %dl, %bl
634 rorl $16, %edx
635 xorl %esi, %ecx
636 movl 72(%edi,%eax,4),%esi
637 movl 1096(%edi,%ebx,4),%ebp
638 movb %dh, %al
639 movb %dl, %bl
640 addl %ebp, %esi
641 movl 2120(%edi,%eax,4),%eax
642 xorl %eax, %esi
643 movl 3144(%edi,%ebx,4),%ebp
644 addl %ebp, %esi
645 xorl %eax, %eax
646 xorl %esi, %ecx
647
648 /* Round 4 */
649 rorl $16, %ecx
650 movl 16(%edi), %esi
651 movb %ch, %al
652 movb %cl, %bl
653 rorl $16, %ecx
654 xorl %esi, %edx
655 movl 72(%edi,%eax,4),%esi
656 movl 1096(%edi,%ebx,4),%ebp
657 movb %ch, %al
658 movb %cl, %bl
659 addl %ebp, %esi
660 movl 2120(%edi,%eax,4),%eax
661 xorl %eax, %esi
662 movl 3144(%edi,%ebx,4),%ebp
663 addl %ebp, %esi
664 xorl %eax, %eax
665 xorl %esi, %edx
666
667 /* Round 3 */
668 rorl $16, %edx
669 movl 12(%edi), %esi
670 movb %dh, %al
671 movb %dl, %bl
672 rorl $16, %edx
673 xorl %esi, %ecx
674 movl 72(%edi,%eax,4),%esi
675 movl 1096(%edi,%ebx,4),%ebp
676 movb %dh, %al
677 movb %dl, %bl
678 addl %ebp, %esi
679 movl 2120(%edi,%eax,4),%eax
680 xorl %eax, %esi
681 movl 3144(%edi,%ebx,4),%ebp
682 addl %ebp, %esi
683 xorl %eax, %eax
684 xorl %esi, %ecx
685
686 /* Round 2 */
687 rorl $16, %ecx
688 movl 8(%edi), %esi
689 movb %ch, %al
690 movb %cl, %bl
691 rorl $16, %ecx
692 xorl %esi, %edx
693 movl 72(%edi,%eax,4),%esi
694 movl 1096(%edi,%ebx,4),%ebp
695 movb %ch, %al
696 movb %cl, %bl
697 addl %ebp, %esi
698 movl 2120(%edi,%eax,4),%eax
699 xorl %eax, %esi
700 movl 3144(%edi,%ebx,4),%ebp
701 addl %ebp, %esi
702 xorl %eax, %eax
703 xorl %esi, %edx
704
705 /* Round 1 */
706 rorl $16, %edx
707 movl 4(%edi), %esi
708 movb %dh, %al
709 movb %dl, %bl
710 rorl $16, %edx
711 xorl %esi, %ecx
712 movl 72(%edi,%eax,4),%esi
713 movl 1096(%edi,%ebx,4),%ebp
714 movb %dh, %al
715 movb %dl, %bl
716 addl %ebp, %esi
717 movl 2120(%edi,%eax,4),%eax
718 xorl %eax, %esi
719 movl 3144(%edi,%ebx,4),%ebp
720 addl %ebp, %esi
721 xorl %eax, %eax
722 xorl %esi, %ecx
723 xorl (%edi), %edx
724 movl 20(%esp), %eax
725 movl %edx, (%eax)
726 movl %ecx, 4(%eax)
727 popl %edi
728 popl %esi
729 popl %ebx
730 popl %ebp
731 ret
732 .L_BF_decrypt_end:
733 .size _C_LABEL(BF_decrypt),.L_BF_decrypt_end-_C_LABEL(BF_decrypt)
734