81fb684cc3
depending on perl at build time. Makefile.asm is a helper for after the next import. With my cvs@ hat on, the relatively small repo cost of this is acceptable, especially given that we have other (much bigger) things like lib*.so.gz.uu checked in under src/lib/compat/*. Reviewed by: kris (maintainer)
903 lines
16 KiB
ArmAsm
903 lines
16 KiB
ArmAsm
# $FreeBSD$
|
|
# Dont even think of reading this code
|
|
# It was automatically generated by bf-686.pl
|
|
# Which is a perl program used to generate the x86 assember for
|
|
# any of elf, a.out, BSDI, Win32, gaswin (for GNU as on Win32) or Solaris
|
|
# eric <eay@cryptsoft.com>
|
|
|
|
.file "bf-686.s"
|
|
.version "01.01"
|
|
gcc2_compiled.:
|
|
.text
|
|
.align 16
|
|
.globl BF_encrypt
|
|
.type BF_encrypt,@function
|
|
BF_encrypt:
|
|
pushl %ebp
|
|
pushl %ebx
|
|
pushl %esi
|
|
pushl %edi
|
|
|
|
|
|
# Load the 2 words
|
|
movl 20(%esp), %eax
|
|
movl (%eax), %ecx
|
|
movl 4(%eax), %edx
|
|
|
|
# P pointer, s and enc flag
|
|
movl 24(%esp), %edi
|
|
xorl %eax, %eax
|
|
xorl %ebx, %ebx
|
|
xorl (%edi), %ecx
|
|
|
|
# Round 0
|
|
rorl $16, %ecx
|
|
movl 4(%edi), %esi
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
rorl $16, %ecx
|
|
xorl %esi, %edx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %edx
|
|
|
|
# Round 1
|
|
rorl $16, %edx
|
|
movl 8(%edi), %esi
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
rorl $16, %edx
|
|
xorl %esi, %ecx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %ecx
|
|
|
|
# Round 2
|
|
rorl $16, %ecx
|
|
movl 12(%edi), %esi
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
rorl $16, %ecx
|
|
xorl %esi, %edx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %edx
|
|
|
|
# Round 3
|
|
rorl $16, %edx
|
|
movl 16(%edi), %esi
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
rorl $16, %edx
|
|
xorl %esi, %ecx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %ecx
|
|
|
|
# Round 4
|
|
rorl $16, %ecx
|
|
movl 20(%edi), %esi
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
rorl $16, %ecx
|
|
xorl %esi, %edx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %edx
|
|
|
|
# Round 5
|
|
rorl $16, %edx
|
|
movl 24(%edi), %esi
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
rorl $16, %edx
|
|
xorl %esi, %ecx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %ecx
|
|
|
|
# Round 6
|
|
rorl $16, %ecx
|
|
movl 28(%edi), %esi
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
rorl $16, %ecx
|
|
xorl %esi, %edx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %edx
|
|
|
|
# Round 7
|
|
rorl $16, %edx
|
|
movl 32(%edi), %esi
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
rorl $16, %edx
|
|
xorl %esi, %ecx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %ecx
|
|
|
|
# Round 8
|
|
rorl $16, %ecx
|
|
movl 36(%edi), %esi
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
rorl $16, %ecx
|
|
xorl %esi, %edx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %edx
|
|
|
|
# Round 9
|
|
rorl $16, %edx
|
|
movl 40(%edi), %esi
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
rorl $16, %edx
|
|
xorl %esi, %ecx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %ecx
|
|
|
|
# Round 10
|
|
rorl $16, %ecx
|
|
movl 44(%edi), %esi
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
rorl $16, %ecx
|
|
xorl %esi, %edx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %edx
|
|
|
|
# Round 11
|
|
rorl $16, %edx
|
|
movl 48(%edi), %esi
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
rorl $16, %edx
|
|
xorl %esi, %ecx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %ecx
|
|
|
|
# Round 12
|
|
rorl $16, %ecx
|
|
movl 52(%edi), %esi
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
rorl $16, %ecx
|
|
xorl %esi, %edx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %edx
|
|
|
|
# Round 13
|
|
rorl $16, %edx
|
|
movl 56(%edi), %esi
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
rorl $16, %edx
|
|
xorl %esi, %ecx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %ecx
|
|
|
|
# Round 14
|
|
rorl $16, %ecx
|
|
movl 60(%edi), %esi
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
rorl $16, %ecx
|
|
xorl %esi, %edx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %edx
|
|
|
|
# Round 15
|
|
rorl $16, %edx
|
|
movl 64(%edi), %esi
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
rorl $16, %edx
|
|
xorl %esi, %ecx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %ecx
|
|
xorl 68(%edi), %edx
|
|
movl 20(%esp), %eax
|
|
movl %edx, (%eax)
|
|
movl %ecx, 4(%eax)
|
|
popl %edi
|
|
popl %esi
|
|
popl %ebx
|
|
popl %ebp
|
|
ret
|
|
.L_BF_encrypt_end:
|
|
.size BF_encrypt,.L_BF_encrypt_end-BF_encrypt
|
|
.ident "desasm.pl"
|
|
.text
|
|
.align 16
|
|
.globl BF_decrypt
|
|
.type BF_decrypt,@function
|
|
BF_decrypt:
|
|
pushl %ebp
|
|
pushl %ebx
|
|
pushl %esi
|
|
pushl %edi
|
|
|
|
|
|
# Load the 2 words
|
|
movl 20(%esp), %eax
|
|
movl (%eax), %ecx
|
|
movl 4(%eax), %edx
|
|
|
|
# P pointer, s and enc flag
|
|
movl 24(%esp), %edi
|
|
xorl %eax, %eax
|
|
xorl %ebx, %ebx
|
|
xorl 68(%edi), %ecx
|
|
|
|
# Round 16
|
|
rorl $16, %ecx
|
|
movl 64(%edi), %esi
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
rorl $16, %ecx
|
|
xorl %esi, %edx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %edx
|
|
|
|
# Round 15
|
|
rorl $16, %edx
|
|
movl 60(%edi), %esi
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
rorl $16, %edx
|
|
xorl %esi, %ecx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %ecx
|
|
|
|
# Round 14
|
|
rorl $16, %ecx
|
|
movl 56(%edi), %esi
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
rorl $16, %ecx
|
|
xorl %esi, %edx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %edx
|
|
|
|
# Round 13
|
|
rorl $16, %edx
|
|
movl 52(%edi), %esi
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
rorl $16, %edx
|
|
xorl %esi, %ecx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %ecx
|
|
|
|
# Round 12
|
|
rorl $16, %ecx
|
|
movl 48(%edi), %esi
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
rorl $16, %ecx
|
|
xorl %esi, %edx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %edx
|
|
|
|
# Round 11
|
|
rorl $16, %edx
|
|
movl 44(%edi), %esi
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
rorl $16, %edx
|
|
xorl %esi, %ecx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %ecx
|
|
|
|
# Round 10
|
|
rorl $16, %ecx
|
|
movl 40(%edi), %esi
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
rorl $16, %ecx
|
|
xorl %esi, %edx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %edx
|
|
|
|
# Round 9
|
|
rorl $16, %edx
|
|
movl 36(%edi), %esi
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
rorl $16, %edx
|
|
xorl %esi, %ecx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %ecx
|
|
|
|
# Round 8
|
|
rorl $16, %ecx
|
|
movl 32(%edi), %esi
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
rorl $16, %ecx
|
|
xorl %esi, %edx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %edx
|
|
|
|
# Round 7
|
|
rorl $16, %edx
|
|
movl 28(%edi), %esi
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
rorl $16, %edx
|
|
xorl %esi, %ecx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %ecx
|
|
|
|
# Round 6
|
|
rorl $16, %ecx
|
|
movl 24(%edi), %esi
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
rorl $16, %ecx
|
|
xorl %esi, %edx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %edx
|
|
|
|
# Round 5
|
|
rorl $16, %edx
|
|
movl 20(%edi), %esi
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
rorl $16, %edx
|
|
xorl %esi, %ecx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %ecx
|
|
|
|
# Round 4
|
|
rorl $16, %ecx
|
|
movl 16(%edi), %esi
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
rorl $16, %ecx
|
|
xorl %esi, %edx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %edx
|
|
|
|
# Round 3
|
|
rorl $16, %edx
|
|
movl 12(%edi), %esi
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
rorl $16, %edx
|
|
xorl %esi, %ecx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %ecx
|
|
|
|
# Round 2
|
|
rorl $16, %ecx
|
|
movl 8(%edi), %esi
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
rorl $16, %ecx
|
|
xorl %esi, %edx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %ch, %al
|
|
movb %cl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %edx
|
|
|
|
# Round 1
|
|
rorl $16, %edx
|
|
movl 4(%edi), %esi
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
rorl $16, %edx
|
|
xorl %esi, %ecx
|
|
movl 72(%edi,%eax,4),%esi
|
|
movl 1096(%edi,%ebx,4),%ebp
|
|
movb %dh, %al
|
|
movb %dl, %bl
|
|
addl %ebp, %esi
|
|
movl 2120(%edi,%eax,4),%eax
|
|
xorl %eax, %esi
|
|
movl 3144(%edi,%ebx,4),%ebp
|
|
addl %ebp, %esi
|
|
xorl %eax, %eax
|
|
xorl %esi, %ecx
|
|
xorl (%edi), %edx
|
|
movl 20(%esp), %eax
|
|
movl %edx, (%eax)
|
|
movl %ecx, 4(%eax)
|
|
popl %edi
|
|
popl %esi
|
|
popl %ebx
|
|
popl %ebp
|
|
ret
|
|
.L_BF_decrypt_end:
|
|
.size BF_decrypt,.L_BF_decrypt_end-BF_decrypt
|
|
.ident "desasm.pl"
|
|
.text
|
|
.align 16
|
|
.globl BF_cbc_encrypt
|
|
.type BF_cbc_encrypt,@function
|
|
BF_cbc_encrypt:
|
|
|
|
pushl %ebp
|
|
pushl %ebx
|
|
pushl %esi
|
|
pushl %edi
|
|
movl 28(%esp), %ebp
|
|
# getting iv ptr from parameter 4
|
|
movl 36(%esp), %ebx
|
|
movl (%ebx), %esi
|
|
movl 4(%ebx), %edi
|
|
pushl %edi
|
|
pushl %esi
|
|
pushl %edi
|
|
pushl %esi
|
|
movl %esp, %ebx
|
|
movl 36(%esp), %esi
|
|
movl 40(%esp), %edi
|
|
# getting encrypt flag from parameter 5
|
|
movl 56(%esp), %ecx
|
|
# get and push parameter 3
|
|
movl 48(%esp), %eax
|
|
pushl %eax
|
|
pushl %ebx
|
|
cmpl $0, %ecx
|
|
jz .L000decrypt
|
|
andl $4294967288, %ebp
|
|
movl 8(%esp), %eax
|
|
movl 12(%esp), %ebx
|
|
jz .L001encrypt_finish
|
|
.L002encrypt_loop:
|
|
movl (%esi), %ecx
|
|
movl 4(%esi), %edx
|
|
xorl %ecx, %eax
|
|
xorl %edx, %ebx
|
|
.byte 15
|
|
.byte 200 # bswapl %eax
|
|
.byte 15
|
|
.byte 203 # bswapl %ebx
|
|
movl %eax, 8(%esp)
|
|
movl %ebx, 12(%esp)
|
|
call BF_encrypt
|
|
movl 8(%esp), %eax
|
|
movl 12(%esp), %ebx
|
|
.byte 15
|
|
.byte 200 # bswapl %eax
|
|
.byte 15
|
|
.byte 203 # bswapl %ebx
|
|
movl %eax, (%edi)
|
|
movl %ebx, 4(%edi)
|
|
addl $8, %esi
|
|
addl $8, %edi
|
|
subl $8, %ebp
|
|
jnz .L002encrypt_loop
|
|
.L001encrypt_finish:
|
|
movl 52(%esp), %ebp
|
|
andl $7, %ebp
|
|
jz .L003finish
|
|
xorl %ecx, %ecx
|
|
xorl %edx, %edx
|
|
movl .L004cbc_enc_jmp_table(,%ebp,4),%ebp
|
|
jmp *%ebp
|
|
.L005ej7:
|
|
movb 6(%esi), %dh
|
|
sall $8, %edx
|
|
.L006ej6:
|
|
movb 5(%esi), %dh
|
|
.L007ej5:
|
|
movb 4(%esi), %dl
|
|
.L008ej4:
|
|
movl (%esi), %ecx
|
|
jmp .L009ejend
|
|
.L010ej3:
|
|
movb 2(%esi), %ch
|
|
sall $8, %ecx
|
|
.L011ej2:
|
|
movb 1(%esi), %ch
|
|
.L012ej1:
|
|
movb (%esi), %cl
|
|
.L009ejend:
|
|
xorl %ecx, %eax
|
|
xorl %edx, %ebx
|
|
.byte 15
|
|
.byte 200 # bswapl %eax
|
|
.byte 15
|
|
.byte 203 # bswapl %ebx
|
|
movl %eax, 8(%esp)
|
|
movl %ebx, 12(%esp)
|
|
call BF_encrypt
|
|
movl 8(%esp), %eax
|
|
movl 12(%esp), %ebx
|
|
.byte 15
|
|
.byte 200 # bswapl %eax
|
|
.byte 15
|
|
.byte 203 # bswapl %ebx
|
|
movl %eax, (%edi)
|
|
movl %ebx, 4(%edi)
|
|
jmp .L003finish
|
|
.align 16
|
|
.L000decrypt:
|
|
andl $4294967288, %ebp
|
|
movl 16(%esp), %eax
|
|
movl 20(%esp), %ebx
|
|
jz .L013decrypt_finish
|
|
.L014decrypt_loop:
|
|
movl (%esi), %eax
|
|
movl 4(%esi), %ebx
|
|
.byte 15
|
|
.byte 200 # bswapl %eax
|
|
.byte 15
|
|
.byte 203 # bswapl %ebx
|
|
movl %eax, 8(%esp)
|
|
movl %ebx, 12(%esp)
|
|
call BF_decrypt
|
|
movl 8(%esp), %eax
|
|
movl 12(%esp), %ebx
|
|
.byte 15
|
|
.byte 200 # bswapl %eax
|
|
.byte 15
|
|
.byte 203 # bswapl %ebx
|
|
movl 16(%esp), %ecx
|
|
movl 20(%esp), %edx
|
|
xorl %eax, %ecx
|
|
xorl %ebx, %edx
|
|
movl (%esi), %eax
|
|
movl 4(%esi), %ebx
|
|
movl %ecx, (%edi)
|
|
movl %edx, 4(%edi)
|
|
movl %eax, 16(%esp)
|
|
movl %ebx, 20(%esp)
|
|
addl $8, %esi
|
|
addl $8, %edi
|
|
subl $8, %ebp
|
|
jnz .L014decrypt_loop
|
|
.L013decrypt_finish:
|
|
movl 52(%esp), %ebp
|
|
andl $7, %ebp
|
|
jz .L003finish
|
|
movl (%esi), %eax
|
|
movl 4(%esi), %ebx
|
|
.byte 15
|
|
.byte 200 # bswapl %eax
|
|
.byte 15
|
|
.byte 203 # bswapl %ebx
|
|
movl %eax, 8(%esp)
|
|
movl %ebx, 12(%esp)
|
|
call BF_decrypt
|
|
movl 8(%esp), %eax
|
|
movl 12(%esp), %ebx
|
|
.byte 15
|
|
.byte 200 # bswapl %eax
|
|
.byte 15
|
|
.byte 203 # bswapl %ebx
|
|
movl 16(%esp), %ecx
|
|
movl 20(%esp), %edx
|
|
xorl %eax, %ecx
|
|
xorl %ebx, %edx
|
|
movl (%esi), %eax
|
|
movl 4(%esi), %ebx
|
|
.L015dj7:
|
|
rorl $16, %edx
|
|
movb %dl, 6(%edi)
|
|
shrl $16, %edx
|
|
.L016dj6:
|
|
movb %dh, 5(%edi)
|
|
.L017dj5:
|
|
movb %dl, 4(%edi)
|
|
.L018dj4:
|
|
movl %ecx, (%edi)
|
|
jmp .L019djend
|
|
.L020dj3:
|
|
rorl $16, %ecx
|
|
movb %cl, 2(%edi)
|
|
sall $16, %ecx
|
|
.L021dj2:
|
|
movb %ch, 1(%esi)
|
|
.L022dj1:
|
|
movb %cl, (%esi)
|
|
.L019djend:
|
|
jmp .L003finish
|
|
.align 16
|
|
.L003finish:
|
|
movl 60(%esp), %ecx
|
|
addl $24, %esp
|
|
movl %eax, (%ecx)
|
|
movl %ebx, 4(%ecx)
|
|
popl %edi
|
|
popl %esi
|
|
popl %ebx
|
|
popl %ebp
|
|
ret
|
|
.align 16
|
|
.L004cbc_enc_jmp_table:
|
|
.long 0
|
|
.long .L012ej1
|
|
.long .L011ej2
|
|
.long .L010ej3
|
|
.long .L008ej4
|
|
.long .L007ej5
|
|
.long .L006ej6
|
|
.long .L005ej7
|
|
.align 16
|
|
.L023cbc_dec_jmp_table:
|
|
.long 0
|
|
.long .L022dj1
|
|
.long .L021dj2
|
|
.long .L020dj3
|
|
.long .L018dj4
|
|
.long .L017dj5
|
|
.long .L016dj6
|
|
.long .L015dj7
|
|
.L_BF_cbc_encrypt_end:
|
|
.size BF_cbc_encrypt,.L_BF_cbc_encrypt_end-BF_cbc_encrypt
|
|
.ident "desasm.pl"
|