1 /* Run the C pre-processor over this file with one of the following defined
2 * ELF - elf object files,
3 * OUT - a.out object files,
4 * BSDI - BSDI style a.out object files
5 * SOL - Solaris style elf
8 #define TYPE(a,b) .type a,b
9 #define SIZE(a,b) .size a,b
11 #if defined(OUT) || defined(BSDI)
12 #define BF_encrypt _BF_encrypt
13 #define BF_decrypt _BF_decrypt
14 #define BF_cbc_encrypt _BF_cbc_encrypt
32 #if defined(ELF) || defined(SOL)
38 You need to define one of
39 ELF - elf systems - linux-elf, NetBSD and DG-UX
40 OUT - a.out systems - linux-a.out and FreeBSD
41 SOL - solaris systems, which are elf with strange comment lines
42 BSDI - a.out with a very primative version of as.
45 /* Let the Assembler begin :-) */
46 /* Don't even think of reading this code */
47 /* It was automatically generated by bf-586.pl */
48 /* Which is a perl program used to generate the x86 assember for */
49 /* any of elf, a.out, BSDI,Win32, or Solaris */
50 /* eric <eay@cryptsoft.com> */
58 TYPE(BF_encrypt,@function)
67 /* Load the 2 words */
85 movl 72(%ebp,%eax,4),%eax
86 movl 1096(%ebp,%ebx,4),%ebx
88 movl 2120(%ebp,%ecx,4),%eax
90 movl 3144(%ebp,%edx,4),%edx
105 movl 72(%ebp,%eax,4),%eax
106 movl 1096(%ebp,%ebx,4),%ebx
108 movl 2120(%ebp,%ecx,4),%eax
110 movl 3144(%ebp,%edx,4),%edx
125 movl 72(%ebp,%eax,4),%eax
126 movl 1096(%ebp,%ebx,4),%ebx
128 movl 2120(%ebp,%ecx,4),%eax
130 movl 3144(%ebp,%edx,4),%edx
145 movl 72(%ebp,%eax,4),%eax
146 movl 1096(%ebp,%ebx,4),%ebx
148 movl 2120(%ebp,%ecx,4),%eax
150 movl 3144(%ebp,%edx,4),%edx
165 movl 72(%ebp,%eax,4),%eax
166 movl 1096(%ebp,%ebx,4),%ebx
168 movl 2120(%ebp,%ecx,4),%eax
170 movl 3144(%ebp,%edx,4),%edx
185 movl 72(%ebp,%eax,4),%eax
186 movl 1096(%ebp,%ebx,4),%ebx
188 movl 2120(%ebp,%ecx,4),%eax
190 movl 3144(%ebp,%edx,4),%edx
205 movl 72(%ebp,%eax,4),%eax
206 movl 1096(%ebp,%ebx,4),%ebx
208 movl 2120(%ebp,%ecx,4),%eax
210 movl 3144(%ebp,%edx,4),%edx
225 movl 72(%ebp,%eax,4),%eax
226 movl 1096(%ebp,%ebx,4),%ebx
228 movl 2120(%ebp,%ecx,4),%eax
230 movl 3144(%ebp,%edx,4),%edx
245 movl 72(%ebp,%eax,4),%eax
246 movl 1096(%ebp,%ebx,4),%ebx
248 movl 2120(%ebp,%ecx,4),%eax
250 movl 3144(%ebp,%edx,4),%edx
265 movl 72(%ebp,%eax,4),%eax
266 movl 1096(%ebp,%ebx,4),%ebx
268 movl 2120(%ebp,%ecx,4),%eax
270 movl 3144(%ebp,%edx,4),%edx
285 movl 72(%ebp,%eax,4),%eax
286 movl 1096(%ebp,%ebx,4),%ebx
288 movl 2120(%ebp,%ecx,4),%eax
290 movl 3144(%ebp,%edx,4),%edx
305 movl 72(%ebp,%eax,4),%eax
306 movl 1096(%ebp,%ebx,4),%ebx
308 movl 2120(%ebp,%ecx,4),%eax
310 movl 3144(%ebp,%edx,4),%edx
325 movl 72(%ebp,%eax,4),%eax
326 movl 1096(%ebp,%ebx,4),%ebx
328 movl 2120(%ebp,%ecx,4),%eax
330 movl 3144(%ebp,%edx,4),%edx
345 movl 72(%ebp,%eax,4),%eax
346 movl 1096(%ebp,%ebx,4),%ebx
348 movl 2120(%ebp,%ecx,4),%eax
350 movl 3144(%ebp,%edx,4),%edx
365 movl 72(%ebp,%eax,4),%eax
366 movl 1096(%ebp,%ebx,4),%ebx
368 movl 2120(%ebp,%ecx,4),%eax
370 movl 3144(%ebp,%edx,4),%edx
385 movl 72(%ebp,%eax,4),%eax
386 movl 1096(%ebp,%ebx,4),%ebx
388 movl 2120(%ebp,%ecx,4),%eax
390 movl 3144(%ebp,%edx,4),%edx
392 /* Load parameter 0 (16) enc=1 */
405 SIZE(BF_encrypt,.BF_encrypt_end-BF_encrypt)
410 TYPE(BF_decrypt,@function)
419 /* Load the 2 words */
437 movl 72(%ebp,%eax,4),%eax
438 movl 1096(%ebp,%ebx,4),%ebx
440 movl 2120(%ebp,%ecx,4),%eax
442 movl 3144(%ebp,%edx,4),%edx
457 movl 72(%ebp,%eax,4),%eax
458 movl 1096(%ebp,%ebx,4),%ebx
460 movl 2120(%ebp,%ecx,4),%eax
462 movl 3144(%ebp,%edx,4),%edx
477 movl 72(%ebp,%eax,4),%eax
478 movl 1096(%ebp,%ebx,4),%ebx
480 movl 2120(%ebp,%ecx,4),%eax
482 movl 3144(%ebp,%edx,4),%edx
497 movl 72(%ebp,%eax,4),%eax
498 movl 1096(%ebp,%ebx,4),%ebx
500 movl 2120(%ebp,%ecx,4),%eax
502 movl 3144(%ebp,%edx,4),%edx
517 movl 72(%ebp,%eax,4),%eax
518 movl 1096(%ebp,%ebx,4),%ebx
520 movl 2120(%ebp,%ecx,4),%eax
522 movl 3144(%ebp,%edx,4),%edx
537 movl 72(%ebp,%eax,4),%eax
538 movl 1096(%ebp,%ebx,4),%ebx
540 movl 2120(%ebp,%ecx,4),%eax
542 movl 3144(%ebp,%edx,4),%edx
557 movl 72(%ebp,%eax,4),%eax
558 movl 1096(%ebp,%ebx,4),%ebx
560 movl 2120(%ebp,%ecx,4),%eax
562 movl 3144(%ebp,%edx,4),%edx
577 movl 72(%ebp,%eax,4),%eax
578 movl 1096(%ebp,%ebx,4),%ebx
580 movl 2120(%ebp,%ecx,4),%eax
582 movl 3144(%ebp,%edx,4),%edx
597 movl 72(%ebp,%eax,4),%eax
598 movl 1096(%ebp,%ebx,4),%ebx
600 movl 2120(%ebp,%ecx,4),%eax
602 movl 3144(%ebp,%edx,4),%edx
617 movl 72(%ebp,%eax,4),%eax
618 movl 1096(%ebp,%ebx,4),%ebx
620 movl 2120(%ebp,%ecx,4),%eax
622 movl 3144(%ebp,%edx,4),%edx
637 movl 72(%ebp,%eax,4),%eax
638 movl 1096(%ebp,%ebx,4),%ebx
640 movl 2120(%ebp,%ecx,4),%eax
642 movl 3144(%ebp,%edx,4),%edx
657 movl 72(%ebp,%eax,4),%eax
658 movl 1096(%ebp,%ebx,4),%ebx
660 movl 2120(%ebp,%ecx,4),%eax
662 movl 3144(%ebp,%edx,4),%edx
677 movl 72(%ebp,%eax,4),%eax
678 movl 1096(%ebp,%ebx,4),%ebx
680 movl 2120(%ebp,%ecx,4),%eax
682 movl 3144(%ebp,%edx,4),%edx
697 movl 72(%ebp,%eax,4),%eax
698 movl 1096(%ebp,%ebx,4),%ebx
700 movl 2120(%ebp,%ecx,4),%eax
702 movl 3144(%ebp,%edx,4),%edx
717 movl 72(%ebp,%eax,4),%eax
718 movl 1096(%ebp,%ebx,4),%ebx
720 movl 2120(%ebp,%ecx,4),%eax
722 movl 3144(%ebp,%edx,4),%edx
737 movl 72(%ebp,%eax,4),%eax
738 movl 1096(%ebp,%ebx,4),%ebx
740 movl 2120(%ebp,%ecx,4),%eax
742 movl 3144(%ebp,%edx,4),%edx
744 /* Load parameter 0 (1) enc=0 */
757 SIZE(BF_decrypt,.BF_decrypt_end-BF_decrypt)
761 .globl BF_cbc_encrypt
762 TYPE(BF_cbc_encrypt,@function)
770 /* getting iv ptr from parameter 4 */
781 /* getting encrypt flag from parameter 5 */
783 /* get and push parameter 3 */
789 andl $4294967288, %ebp
792 jz .L001encrypt_finish
799 .byte 200 /* bswapl %eax */
801 .byte 203 /* bswapl %ebx */
808 .byte 200 /* bswapl %eax */
810 .byte 203 /* bswapl %ebx */
816 jnz .L002encrypt_loop
823 movl .L004cbc_enc_jmp_table(,%ebp,4),%ebp
846 .byte 200 /* bswapl %eax */
848 .byte 203 /* bswapl %ebx */
855 .byte 200 /* bswapl %eax */
857 .byte 203 /* bswapl %ebx */
863 andl $4294967288, %ebp
866 jz .L013decrypt_finish
871 .byte 200 /* bswapl %eax */
873 .byte 203 /* bswapl %ebx */
880 .byte 200 /* bswapl %eax */
882 .byte 203 /* bswapl %ebx */
896 jnz .L014decrypt_loop
904 .byte 200 /* bswapl %eax */
906 .byte 203 /* bswapl %ebx */
913 .byte 200 /* bswapl %eax */
915 .byte 203 /* bswapl %ebx */
955 .L004cbc_enc_jmp_table:
965 .L023cbc_dec_jmp_table:
975 SIZE(BF_cbc_encrypt,.BF_cbc_encrypt_end-BF_cbc_encrypt)