From aba2163a0699e8bd9b436febd661f4591dccf9f9 Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Fri, 9 Apr 2004 15:48:50 +0000 Subject: [PATCH] Add x86 assembler. --- Configure | 4 + Makefile.org | 11 +- crypto/des/des_enc.c | 4 + fips/Makefile | 6 +- fips/des/Makefile | 6 +- fips/des/asm/fips-dx86-elf.s | 2697 ++++++++++++++++++++++++++++++++++ fips/des/fingerprint.sha1 | 1 + fips/fips_make_sha1 | 2 +- 8 files changed, 2720 insertions(+), 11 deletions(-) create mode 100644 fips/des/asm/fips-dx86-elf.s diff --git a/Configure b/Configure index 969c11b772..a75a6ae6c9 100755 --- a/Configure +++ b/Configure @@ -622,6 +622,7 @@ my $rc2 ="crypto/rc2/rc2.h"; my $bf ="crypto/bf/bf_locl.h"; my $bn_asm ="bn_asm.o"; my $des_enc="des_enc.o fcrypt_b.o"; +my $fips_des_enc="fips_des_enc.o"; my $bf_enc ="bf_enc.o"; my $cast_enc="c_enc.o"; my $rc4_enc="rc4_enc.o"; @@ -1156,6 +1157,8 @@ if ($fips) $des_obj=$sha1_obj=""; } $des_obj=$des_enc unless (!$fips && $des_obj =~ /\.o$/); +my $fips_des_obj='asm/fips-dx86-elf.o'; +$fips_des_obj=$fips_des_enc unless $processor eq '386'; $bf_obj=$bf_enc unless ($bf_obj =~ /\.o$/); $cast_obj=$cast_enc unless ($cast_obj =~ /\.o$/); $rc4_obj=$rc4_enc unless ($rc4_obj =~ /\.o$/); @@ -1254,6 +1257,7 @@ while () s/^EXE_EXT=.*$/EXE_EXT= $exe_ext/; s/^BN_ASM=.*$/BN_ASM= $bn_obj/; s/^DES_ENC=.*$/DES_ENC= $des_obj/; + s/^FIPS_DES_ENC=.*$/FIPS_DES_ENC= $fips_des_obj/; s/^BF_ENC=.*$/BF_ENC= $bf_obj/; s/^CAST_ENC=.*$/CAST_ENC= $cast_obj/; s/^RC4_ENC=.*$/RC4_ENC= $rc4_obj/; diff --git a/Makefile.org b/Makefile.org index 72d32eb0b4..4051fcf033 100644 --- a/Makefile.org +++ b/Makefile.org @@ -101,6 +101,7 @@ PROCESSOR= # Set DES_ENC to des_enc.o if you want to use the C version #There are 4 x86 assember options. +FIPS_DES_ENC= des_enc.o fcrypt_b.o DES_ENC= asm/dx86-out.o asm/yx86-out.o #DES_ENC= des_enc.o fcrypt_b.o # C #DES_ENC= asm/dx86-elf.o asm/yx86-elf.o # elf @@ -235,7 +236,7 @@ sub_all: do \ if [ -d "$$i" ]; then \ (cd $$i && echo "making all in $$i..." && \ - $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAG='${ASFLAG}' SDIRS='$(SDIRS)' FDIRS='$(FDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' all ) || exit 1; \ + $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAG='${ASFLAG}' SDIRS='$(SDIRS)' FDIRS='$(FDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' all ) || exit 1; \ else \ $(MAKE) $$i; \ fi; \ @@ -246,7 +247,7 @@ sub_target: do \ if [ -d "$$i" ]; then \ (cd $$i && echo "making $(TARGET) in $$i..." && \ - $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAG='${ASFLAG}' SDIRS='$(SDIRS)' FDIRS='$(FDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TARGET='$(TARGET)' sub_target ) || exit 1; \ + $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAG='${ASFLAG}' SDIRS='$(SDIRS)' FDIRS='$(FDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TARGET='$(TARGET)' sub_target ) || exit 1; \ else \ $(MAKE) $$i; \ fi; \ @@ -656,13 +657,13 @@ links: @for i in $(DIRS); do \ if [ -d "$$i" ]; then \ (cd $$i && echo "making links in $$i..." && \ - $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PERL='${PERL}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' links ) || exit 1; \ + $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PERL='${PERL}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' links ) || exit 1; \ fi; \ done; gentests: @(cd test && echo "generating dummy tests (if needed)..." && \ - $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on generate ); + $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on generate ); dclean: rm -f *.bak @@ -691,7 +692,7 @@ test: tests tests: rehash @(cd test && echo "testing..." && \ - $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests ); + $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests ); @LD_LIBRARY_PATH="`pwd`:$$LD_LIBRARY_PATH"; \ DYLD_LIBRARY_PATH="`pwd`:$$DYLD_LIBRARY_PATH"; \ SHLIB_PATH="`pwd`:$$SHLIB_PATH"; \ diff --git a/crypto/des/des_enc.c b/crypto/des/des_enc.c index 21854270c7..8dd30e2cb7 100644 --- a/crypto/des/des_enc.c +++ b/crypto/des/des_enc.c @@ -293,6 +293,8 @@ void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1, #ifndef DES_DEFAULT_OPTIONS +#if !defined(OPENSSL_FIPS) || !defined(I386_ONLY) + #undef CBC_ENC_C__DONT_UPDATE_IV #include "ncbc_enc.c" /* DES_ncbc_encrypt */ @@ -408,4 +410,6 @@ void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output, tin[0]=tin[1]=0; } +#endif /* !defined(OPENSSL_FIPS) || !defined(I386_ONLY) */ + #endif /* DES_DEFAULT_OPTIONS */ diff --git a/fips/Makefile b/fips/Makefile index f4a8797087..2feecef946 100644 --- a/fips/Makefile +++ b/fips/Makefile @@ -54,14 +54,14 @@ subdirs: @for i in $(FDIRS) ;\ do \ (cd $$i && echo "making all in fips/$$i..." && \ - $(MAKE) CC='$(CC)' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' all ) || exit 1; \ + $(MAKE) CC='$(CC)' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' all ) || exit 1; \ done; sub_target: @for i in $(FDIRS) ;\ do \ (cd $$i && echo "making $(TARGET) in fips/$$i..." && \ - $(MAKE) CC='$(CC)' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' $(TARGET) ) || exit 1; \ + $(MAKE) CC='$(CC)' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' $(TARGET) ) || exit 1; \ done; files: @@ -76,7 +76,7 @@ links: @$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER) @for i in $(FDIRS); do \ (cd $$i && echo "making links in fips/$$i..." && \ - $(MAKE) CC='$(CC)' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' AR='${AR}' PERL='${PERL}' links ); \ + $(MAKE) CC='$(CC)' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' AR='${AR}' PERL='${PERL}' links ); \ done; lib: $(LIBOBJ) diff --git a/fips/des/Makefile b/fips/des/Makefile index cb01f974a2..7d38bc7ed5 100644 --- a/fips/des/Makefile +++ b/fips/des/Makefile @@ -15,6 +15,8 @@ MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) MAKEFILE= Makefile AR= ar r +FIPS_DES_ENC=fips_des_enc.o + CFLAGS= $(INCLUDES) $(CFLAG) -g GENERAL=Makefile @@ -22,8 +24,8 @@ TEST= fips_desmovs.c APPS= LIB=$(TOP)/libcrypto.a -LIBSRC=fips_des_enc.c fips_des_selftest.c fips_set_key.c -LIBOBJ=fips_des_enc.o fips_des_selftest.o fips_set_key.o +LIBSRC=fips_des_enc.c asm/fips-dx86-elf.s fips_des_selftest.c fips_set_key.c +LIBOBJ=$(FIPS_DES_ENC) fips_des_selftest.o fips_set_key.o SRC= $(LIBSRC) diff --git a/fips/des/asm/fips-dx86-elf.s b/fips/des/asm/fips-dx86-elf.s new file mode 100644 index 0000000000..c9939221e4 --- /dev/null +++ b/fips/des/asm/fips-dx86-elf.s @@ -0,0 +1,2697 @@ + + + + + + + .file "des-586.s" + .version "01.01" +gcc2_compiled.: +.text + .align 16 +.globl DES_encrypt1 + .type DES_encrypt1,@function +DES_encrypt1: + pushl %esi + pushl %edi + + + movl 12(%esp), %esi + xorl %ecx, %ecx + pushl %ebx + pushl %ebp + movl (%esi), %eax + movl 28(%esp), %ebx + movl 4(%esi), %edi + + + roll $4, %eax + movl %eax, %esi + xorl %edi, %eax + andl $0xf0f0f0f0, %eax + xorl %eax, %esi + xorl %eax, %edi + + roll $20, %edi + movl %edi, %eax + xorl %esi, %edi + andl $0xfff0000f, %edi + xorl %edi, %eax + xorl %edi, %esi + + roll $14, %eax + movl %eax, %edi + xorl %esi, %eax + andl $0x33333333, %eax + xorl %eax, %edi + xorl %eax, %esi + + roll $22, %esi + movl %esi, %eax + xorl %edi, %esi + andl $0x03fc03fc, %esi + xorl %esi, %eax + xorl %esi, %edi + + roll $9, %eax + movl %eax, %esi + xorl %edi, %eax + andl $0xaaaaaaaa, %eax + xorl %eax, %esi + xorl %eax, %edi + +.byte 209 +.byte 199 + leal DES_SPtrans, %ebp + movl 24(%esp), %ecx + cmpl $0, %ebx + je .L000start_decrypt + + + movl (%ecx), %eax + xorl %ebx, %ebx + movl 4(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 8(%ecx), %eax + xorl %ebx, %ebx + movl 12(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 16(%ecx), %eax + xorl %ebx, %ebx + movl 20(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 24(%ecx), %eax + xorl %ebx, %ebx + movl 28(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 32(%ecx), %eax + xorl %ebx, %ebx + movl 36(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 40(%ecx), %eax + xorl %ebx, %ebx + movl 44(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 48(%ecx), %eax + xorl %ebx, %ebx + movl 52(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 56(%ecx), %eax + xorl %ebx, %ebx + movl 60(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 64(%ecx), %eax + xorl %ebx, %ebx + movl 68(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 72(%ecx), %eax + xorl %ebx, %ebx + movl 76(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 80(%ecx), %eax + xorl %ebx, %ebx + movl 84(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 88(%ecx), %eax + xorl %ebx, %ebx + movl 92(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 96(%ecx), %eax + xorl %ebx, %ebx + movl 100(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 104(%ecx), %eax + xorl %ebx, %ebx + movl 108(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 112(%ecx), %eax + xorl %ebx, %ebx + movl 116(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 120(%ecx), %eax + xorl %ebx, %ebx + movl 124(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + jmp .L001end +.L000start_decrypt: + + + movl 120(%ecx), %eax + xorl %ebx, %ebx + movl 124(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 112(%ecx), %eax + xorl %ebx, %ebx + movl 116(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 104(%ecx), %eax + xorl %ebx, %ebx + movl 108(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 96(%ecx), %eax + xorl %ebx, %ebx + movl 100(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 88(%ecx), %eax + xorl %ebx, %ebx + movl 92(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 80(%ecx), %eax + xorl %ebx, %ebx + movl 84(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 72(%ecx), %eax + xorl %ebx, %ebx + movl 76(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 64(%ecx), %eax + xorl %ebx, %ebx + movl 68(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 56(%ecx), %eax + xorl %ebx, %ebx + movl 60(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 48(%ecx), %eax + xorl %ebx, %ebx + movl 52(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 40(%ecx), %eax + xorl %ebx, %ebx + movl 44(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 32(%ecx), %eax + xorl %ebx, %ebx + movl 36(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 24(%ecx), %eax + xorl %ebx, %ebx + movl 28(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 16(%ecx), %eax + xorl %ebx, %ebx + movl 20(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 8(%ecx), %eax + xorl %ebx, %ebx + movl 12(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl (%ecx), %eax + xorl %ebx, %ebx + movl 4(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi +.L001end: + + + movl 20(%esp), %edx +.byte 209 +.byte 206 + movl %edi, %eax + xorl %esi, %edi + andl $0xaaaaaaaa, %edi + xorl %edi, %eax + xorl %edi, %esi + + roll $23, %eax + movl %eax, %edi + xorl %esi, %eax + andl $0x03fc03fc, %eax + xorl %eax, %edi + xorl %eax, %esi + + roll $10, %edi + movl %edi, %eax + xorl %esi, %edi + andl $0x33333333, %edi + xorl %edi, %eax + xorl %edi, %esi + + roll $18, %esi + movl %esi, %edi + xorl %eax, %esi + andl $0xfff0000f, %esi + xorl %esi, %edi + xorl %esi, %eax + + roll $12, %edi + movl %edi, %esi + xorl %eax, %edi + andl $0xf0f0f0f0, %edi + xorl %edi, %esi + xorl %edi, %eax + + rorl $4, %eax + movl %eax, (%edx) + movl %esi, 4(%edx) + popl %ebp + popl %ebx + popl %edi + popl %esi + ret +.L_DES_encrypt1_end: + .size DES_encrypt1,.L_DES_encrypt1_end-DES_encrypt1 +.ident "desasm.pl" +.text + .align 16 +.globl DES_encrypt2 + .type DES_encrypt2,@function +DES_encrypt2: + pushl %esi + pushl %edi + + + movl 12(%esp), %eax + xorl %ecx, %ecx + pushl %ebx + pushl %ebp + movl (%eax), %esi + movl 28(%esp), %ebx + roll $3, %esi + movl 4(%eax), %edi + roll $3, %edi + leal DES_SPtrans, %ebp + movl 24(%esp), %ecx + cmpl $0, %ebx + je .L002start_decrypt + + + movl (%ecx), %eax + xorl %ebx, %ebx + movl 4(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 8(%ecx), %eax + xorl %ebx, %ebx + movl 12(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 16(%ecx), %eax + xorl %ebx, %ebx + movl 20(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 24(%ecx), %eax + xorl %ebx, %ebx + movl 28(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 32(%ecx), %eax + xorl %ebx, %ebx + movl 36(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 40(%ecx), %eax + xorl %ebx, %ebx + movl 44(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 48(%ecx), %eax + xorl %ebx, %ebx + movl 52(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 56(%ecx), %eax + xorl %ebx, %ebx + movl 60(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 64(%ecx), %eax + xorl %ebx, %ebx + movl 68(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 72(%ecx), %eax + xorl %ebx, %ebx + movl 76(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 80(%ecx), %eax + xorl %ebx, %ebx + movl 84(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 88(%ecx), %eax + xorl %ebx, %ebx + movl 92(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 96(%ecx), %eax + xorl %ebx, %ebx + movl 100(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 104(%ecx), %eax + xorl %ebx, %ebx + movl 108(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 112(%ecx), %eax + xorl %ebx, %ebx + movl 116(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 120(%ecx), %eax + xorl %ebx, %ebx + movl 124(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + jmp .L003end +.L002start_decrypt: + + + movl 120(%ecx), %eax + xorl %ebx, %ebx + movl 124(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 112(%ecx), %eax + xorl %ebx, %ebx + movl 116(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 104(%ecx), %eax + xorl %ebx, %ebx + movl 108(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 96(%ecx), %eax + xorl %ebx, %ebx + movl 100(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 88(%ecx), %eax + xorl %ebx, %ebx + movl 92(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 80(%ecx), %eax + xorl %ebx, %ebx + movl 84(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 72(%ecx), %eax + xorl %ebx, %ebx + movl 76(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 64(%ecx), %eax + xorl %ebx, %ebx + movl 68(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 56(%ecx), %eax + xorl %ebx, %ebx + movl 60(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 48(%ecx), %eax + xorl %ebx, %ebx + movl 52(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 40(%ecx), %eax + xorl %ebx, %ebx + movl 44(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 32(%ecx), %eax + xorl %ebx, %ebx + movl 36(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 24(%ecx), %eax + xorl %ebx, %ebx + movl 28(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl 16(%ecx), %eax + xorl %ebx, %ebx + movl 20(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi + + + movl 8(%ecx), %eax + xorl %ebx, %ebx + movl 12(%ecx), %edx + xorl %esi, %eax + xorl %ecx, %ecx + xorl %esi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%edi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%edi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%edi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%edi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%edi + xorl 0x700(%ebp,%ecx),%edi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%edi + xorl 0x500(%ebp,%edx),%edi + + + movl (%ecx), %eax + xorl %ebx, %ebx + movl 4(%ecx), %edx + xorl %edi, %eax + xorl %ecx, %ecx + xorl %edi, %edx + andl $0xfcfcfcfc, %eax + andl $0xcfcfcfcf, %edx + movb %al, %bl + movb %ah, %cl + rorl $4, %edx + xorl (%ebp,%ebx),%esi + movb %dl, %bl + xorl 0x200(%ebp,%ecx),%esi + movb %dh, %cl + shrl $16, %eax + xorl 0x100(%ebp,%ebx),%esi + movb %ah, %bl + shrl $16, %edx + xorl 0x300(%ebp,%ecx),%esi + movb %dh, %cl + andl $0xff, %eax + andl $0xff, %edx + xorl 0x600(%ebp,%ebx),%esi + xorl 0x700(%ebp,%ecx),%esi + movl 24(%esp), %ecx + xorl 0x400(%ebp,%eax),%esi + xorl 0x500(%ebp,%edx),%esi +.L003end: + + + rorl $3, %edi + movl 20(%esp), %eax + rorl $3, %esi + movl %edi, (%eax) + movl %esi, 4(%eax) + popl %ebp + popl %ebx + popl %edi + popl %esi + ret +.L_DES_encrypt2_end: + .size DES_encrypt2,.L_DES_encrypt2_end-DES_encrypt2 +.ident "desasm.pl" +.text + .align 16 +.globl DES_encrypt3 + .type DES_encrypt3,@function +DES_encrypt3: + pushl %ebx + movl 8(%esp), %ebx + pushl %ebp + pushl %esi + pushl %edi + + + movl (%ebx), %edi + movl 4(%ebx), %esi + subl $12, %esp + + + roll $4, %edi + movl %edi, %edx + xorl %esi, %edi + andl $0xf0f0f0f0, %edi + xorl %edi, %edx + xorl %edi, %esi + + roll $20, %esi + movl %esi, %edi + xorl %edx, %esi + andl $0xfff0000f, %esi + xorl %esi, %edi + xorl %esi, %edx + + roll $14, %edi + movl %edi, %esi + xorl %edx, %edi + andl $0x33333333, %edi + xorl %edi, %esi + xorl %edi, %edx + + roll $22, %edx + movl %edx, %edi + xorl %esi, %edx + andl $0x03fc03fc, %edx + xorl %edx, %edi + xorl %edx, %esi + + roll $9, %edi + movl %edi, %edx + xorl %esi, %edi + andl $0xaaaaaaaa, %edi + xorl %edi, %edx + xorl %edi, %esi + + rorl $3, %edx + rorl $2, %esi + movl %esi, 4(%ebx) + movl 36(%esp), %eax + movl %edx, (%ebx) + movl 40(%esp), %edi + movl 44(%esp), %esi + movl $1, 8(%esp) + movl %eax, 4(%esp) + movl %ebx, (%esp) + call DES_encrypt2 + movl $0, 8(%esp) + movl %edi, 4(%esp) + movl %ebx, (%esp) + call DES_encrypt2 + movl $1, 8(%esp) + movl %esi, 4(%esp) + movl %ebx, (%esp) + call DES_encrypt2 + addl $12, %esp + movl (%ebx), %edi + movl 4(%ebx), %esi + + + roll $2, %esi + roll $3, %edi + movl %edi, %eax + xorl %esi, %edi + andl $0xaaaaaaaa, %edi + xorl %edi, %eax + xorl %edi, %esi + + roll $23, %eax + movl %eax, %edi + xorl %esi, %eax + andl $0x03fc03fc, %eax + xorl %eax, %edi + xorl %eax, %esi + + roll $10, %edi + movl %edi, %eax + xorl %esi, %edi + andl $0x33333333, %edi + xorl %edi, %eax + xorl %edi, %esi + + roll $18, %esi + movl %esi, %edi + xorl %eax, %esi + andl $0xfff0000f, %esi + xorl %esi, %edi + xorl %esi, %eax + + roll $12, %edi + movl %edi, %esi + xorl %eax, %edi + andl $0xf0f0f0f0, %edi + xorl %edi, %esi + xorl %edi, %eax + + rorl $4, %eax + movl %eax, (%ebx) + movl %esi, 4(%ebx) + popl %edi + popl %esi + popl %ebp + popl %ebx + ret +.L_DES_encrypt3_end: + .size DES_encrypt3,.L_DES_encrypt3_end-DES_encrypt3 +.ident "desasm.pl" +.text + .align 16 +.globl DES_decrypt3 + .type DES_decrypt3,@function +DES_decrypt3: + pushl %ebx + movl 8(%esp), %ebx + pushl %ebp + pushl %esi + pushl %edi + + + movl (%ebx), %edi + movl 4(%ebx), %esi + subl $12, %esp + + + roll $4, %edi + movl %edi, %edx + xorl %esi, %edi + andl $0xf0f0f0f0, %edi + xorl %edi, %edx + xorl %edi, %esi + + roll $20, %esi + movl %esi, %edi + xorl %edx, %esi + andl $0xfff0000f, %esi + xorl %esi, %edi + xorl %esi, %edx + + roll $14, %edi + movl %edi, %esi + xorl %edx, %edi + andl $0x33333333, %edi + xorl %edi, %esi + xorl %edi, %edx + + roll $22, %edx + movl %edx, %edi + xorl %esi, %edx + andl $0x03fc03fc, %edx + xorl %edx, %edi + xorl %edx, %esi + + roll $9, %edi + movl %edi, %edx + xorl %esi, %edi + andl $0xaaaaaaaa, %edi + xorl %edi, %edx + xorl %edi, %esi + + rorl $3, %edx + rorl $2, %esi + movl %esi, 4(%ebx) + movl 36(%esp), %esi + movl %edx, (%ebx) + movl 40(%esp), %edi + movl 44(%esp), %eax + movl $0, 8(%esp) + movl %eax, 4(%esp) + movl %ebx, (%esp) + call DES_encrypt2 + movl $1, 8(%esp) + movl %edi, 4(%esp) + movl %ebx, (%esp) + call DES_encrypt2 + movl $0, 8(%esp) + movl %esi, 4(%esp) + movl %ebx, (%esp) + call DES_encrypt2 + addl $12, %esp + movl (%ebx), %edi + movl 4(%ebx), %esi + + + roll $2, %esi + roll $3, %edi + movl %edi, %eax + xorl %esi, %edi + andl $0xaaaaaaaa, %edi + xorl %edi, %eax + xorl %edi, %esi + + roll $23, %eax + movl %eax, %edi + xorl %esi, %eax + andl $0x03fc03fc, %eax + xorl %eax, %edi + xorl %eax, %esi + + roll $10, %edi + movl %edi, %eax + xorl %esi, %edi + andl $0x33333333, %edi + xorl %edi, %eax + xorl %edi, %esi + + roll $18, %esi + movl %esi, %edi + xorl %eax, %esi + andl $0xfff0000f, %esi + xorl %esi, %edi + xorl %esi, %eax + + roll $12, %edi + movl %edi, %esi + xorl %eax, %edi + andl $0xf0f0f0f0, %edi + xorl %edi, %esi + xorl %edi, %eax + + rorl $4, %eax + movl %eax, (%ebx) + movl %esi, 4(%ebx) + popl %edi + popl %esi + popl %ebp + popl %ebx + ret +.L_DES_decrypt3_end: + .size DES_decrypt3,.L_DES_decrypt3_end-DES_decrypt3 +.ident "desasm.pl" +.text + .align 16 +.globl DES_ncbc_encrypt + .type DES_ncbc_encrypt,@function +DES_ncbc_encrypt: + + pushl %ebp + pushl %ebx + pushl %esi + pushl %edi + movl 28(%esp), %ebp + + 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 + + movl 56(%esp), %ecx + + pushl %ecx + + movl 52(%esp), %eax + pushl %eax + pushl %ebx + cmpl $0, %ecx + jz .L004decrypt + andl $4294967288, %ebp + movl 12(%esp), %eax + movl 16(%esp), %ebx + jz .L005encrypt_finish +.L006encrypt_loop: + movl (%esi), %ecx + movl 4(%esi), %edx + xorl %ecx, %eax + xorl %edx, %ebx + movl %eax, 12(%esp) + movl %ebx, 16(%esp) + call DES_encrypt1 + movl 12(%esp), %eax + movl 16(%esp), %ebx + movl %eax, (%edi) + movl %ebx, 4(%edi) + addl $8, %esi + addl $8, %edi + subl $8, %ebp + jnz .L006encrypt_loop +.L005encrypt_finish: + movl 56(%esp), %ebp + andl $7, %ebp + jz .L007finish + call .L008PIC_point +.L008PIC_point: + popl %edx + leal .L009cbc_enc_jmp_table-.L008PIC_point(%edx),%ecx + movl (%ecx,%ebp,4), %ebp + addl %edx, %ebp + xorl %ecx, %ecx + xorl %edx, %edx + jmp *%ebp +.L010ej7: + movb 6(%esi), %dh + sall $8, %edx +.L011ej6: + movb 5(%esi), %dh +.L012ej5: + movb 4(%esi), %dl +.L013ej4: + movl (%esi), %ecx + jmp .L014ejend +.L015ej3: + movb 2(%esi), %ch + sall $8, %ecx +.L016ej2: + movb 1(%esi), %ch +.L017ej1: + movb (%esi), %cl +.L014ejend: + xorl %ecx, %eax + xorl %edx, %ebx + movl %eax, 12(%esp) + movl %ebx, 16(%esp) + call DES_encrypt1 + movl 12(%esp), %eax + movl 16(%esp), %ebx + movl %eax, (%edi) + movl %ebx, 4(%edi) + jmp .L007finish +.align 16 +.L004decrypt: + andl $4294967288, %ebp + movl 20(%esp), %eax + movl 24(%esp), %ebx + jz .L018decrypt_finish +.L019decrypt_loop: + movl (%esi), %eax + movl 4(%esi), %ebx + movl %eax, 12(%esp) + movl %ebx, 16(%esp) + call DES_encrypt1 + movl 12(%esp), %eax + movl 16(%esp), %ebx + movl 20(%esp), %ecx + movl 24(%esp), %edx + xorl %eax, %ecx + xorl %ebx, %edx + movl (%esi), %eax + movl 4(%esi), %ebx + movl %ecx, (%edi) + movl %edx, 4(%edi) + movl %eax, 20(%esp) + movl %ebx, 24(%esp) + addl $8, %esi + addl $8, %edi + subl $8, %ebp + jnz .L019decrypt_loop +.L018decrypt_finish: + movl 56(%esp), %ebp + andl $7, %ebp + jz .L007finish + movl (%esi), %eax + movl 4(%esi), %ebx + movl %eax, 12(%esp) + movl %ebx, 16(%esp) + call DES_encrypt1 + movl 12(%esp), %eax + movl 16(%esp), %ebx + movl 20(%esp), %ecx + movl 24(%esp), %edx + xorl %eax, %ecx + xorl %ebx, %edx + movl (%esi), %eax + movl 4(%esi), %ebx +.L020dj7: + rorl $16, %edx + movb %dl, 6(%edi) + shrl $16, %edx +.L021dj6: + movb %dh, 5(%edi) +.L022dj5: + movb %dl, 4(%edi) +.L023dj4: + movl %ecx, (%edi) + jmp .L024djend +.L025dj3: + rorl $16, %ecx + movb %cl, 2(%edi) + sall $16, %ecx +.L026dj2: + movb %ch, 1(%esi) +.L027dj1: + movb %cl, (%esi) +.L024djend: + jmp .L007finish +.align 16 +.L007finish: + movl 64(%esp), %ecx + addl $28, %esp + movl %eax, (%ecx) + movl %ebx, 4(%ecx) + popl %edi + popl %esi + popl %ebx + popl %ebp + ret +.align 16 +.L009cbc_enc_jmp_table: + .long 0 + .long .L017ej1-.L008PIC_point + .long .L016ej2-.L008PIC_point + .long .L015ej3-.L008PIC_point + .long .L013ej4-.L008PIC_point + .long .L012ej5-.L008PIC_point + .long .L011ej6-.L008PIC_point + .long .L010ej7-.L008PIC_point +.L_DES_ncbc_encrypt_end: + .size DES_ncbc_encrypt,.L_DES_ncbc_encrypt_end-DES_ncbc_encrypt +.ident "desasm.pl" +.text + .align 16 +.globl DES_ede3_cbc_encrypt + .type DES_ede3_cbc_encrypt,@function +DES_ede3_cbc_encrypt: + + pushl %ebp + pushl %ebx + pushl %esi + pushl %edi + movl 28(%esp), %ebp + + movl 44(%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 + + movl 64(%esp), %ecx + + movl 56(%esp), %eax + pushl %eax + + movl 56(%esp), %eax + pushl %eax + + movl 56(%esp), %eax + pushl %eax + pushl %ebx + cmpl $0, %ecx + jz .L028decrypt + andl $4294967288, %ebp + movl 16(%esp), %eax + movl 20(%esp), %ebx + jz .L029encrypt_finish +.L030encrypt_loop: + movl (%esi), %ecx + movl 4(%esi), %edx + xorl %ecx, %eax + xorl %edx, %ebx + movl %eax, 16(%esp) + movl %ebx, 20(%esp) + call DES_encrypt3 + movl 16(%esp), %eax + movl 20(%esp), %ebx + movl %eax, (%edi) + movl %ebx, 4(%edi) + addl $8, %esi + addl $8, %edi + subl $8, %ebp + jnz .L030encrypt_loop +.L029encrypt_finish: + movl 60(%esp), %ebp + andl $7, %ebp + jz .L031finish + call .L032PIC_point +.L032PIC_point: + popl %edx + leal .L033cbc_enc_jmp_table-.L032PIC_point(%edx),%ecx + movl (%ecx,%ebp,4), %ebp + addl %edx, %ebp + xorl %ecx, %ecx + xorl %edx, %edx + jmp *%ebp +.L034ej7: + movb 6(%esi), %dh + sall $8, %edx +.L035ej6: + movb 5(%esi), %dh +.L036ej5: + movb 4(%esi), %dl +.L037ej4: + movl (%esi), %ecx + jmp .L038ejend +.L039ej3: + movb 2(%esi), %ch + sall $8, %ecx +.L040ej2: + movb 1(%esi), %ch +.L041ej1: + movb (%esi), %cl +.L038ejend: + xorl %ecx, %eax + xorl %edx, %ebx + movl %eax, 16(%esp) + movl %ebx, 20(%esp) + call DES_encrypt3 + movl 16(%esp), %eax + movl 20(%esp), %ebx + movl %eax, (%edi) + movl %ebx, 4(%edi) + jmp .L031finish +.align 16 +.L028decrypt: + andl $4294967288, %ebp + movl 24(%esp), %eax + movl 28(%esp), %ebx + jz .L042decrypt_finish +.L043decrypt_loop: + movl (%esi), %eax + movl 4(%esi), %ebx + movl %eax, 16(%esp) + movl %ebx, 20(%esp) + call DES_decrypt3 + movl 16(%esp), %eax + movl 20(%esp), %ebx + movl 24(%esp), %ecx + movl 28(%esp), %edx + xorl %eax, %ecx + xorl %ebx, %edx + movl (%esi), %eax + movl 4(%esi), %ebx + movl %ecx, (%edi) + movl %edx, 4(%edi) + movl %eax, 24(%esp) + movl %ebx, 28(%esp) + addl $8, %esi + addl $8, %edi + subl $8, %ebp + jnz .L043decrypt_loop +.L042decrypt_finish: + movl 60(%esp), %ebp + andl $7, %ebp + jz .L031finish + movl (%esi), %eax + movl 4(%esi), %ebx + movl %eax, 16(%esp) + movl %ebx, 20(%esp) + call DES_decrypt3 + movl 16(%esp), %eax + movl 20(%esp), %ebx + movl 24(%esp), %ecx + movl 28(%esp), %edx + xorl %eax, %ecx + xorl %ebx, %edx + movl (%esi), %eax + movl 4(%esi), %ebx +.L044dj7: + rorl $16, %edx + movb %dl, 6(%edi) + shrl $16, %edx +.L045dj6: + movb %dh, 5(%edi) +.L046dj5: + movb %dl, 4(%edi) +.L047dj4: + movl %ecx, (%edi) + jmp .L048djend +.L049dj3: + rorl $16, %ecx + movb %cl, 2(%edi) + sall $16, %ecx +.L050dj2: + movb %ch, 1(%esi) +.L051dj1: + movb %cl, (%esi) +.L048djend: + jmp .L031finish +.align 16 +.L031finish: + movl 76(%esp), %ecx + addl $32, %esp + movl %eax, (%ecx) + movl %ebx, 4(%ecx) + popl %edi + popl %esi + popl %ebx + popl %ebp + ret +.align 16 +.L033cbc_enc_jmp_table: + .long 0 + .long .L041ej1-.L032PIC_point + .long .L040ej2-.L032PIC_point + .long .L039ej3-.L032PIC_point + .long .L037ej4-.L032PIC_point + .long .L036ej5-.L032PIC_point + .long .L035ej6-.L032PIC_point + .long .L034ej7-.L032PIC_point +.L_DES_ede3_cbc_encrypt_end: + .size DES_ede3_cbc_encrypt,.L_DES_ede3_cbc_encrypt_end-DES_ede3_cbc_encrypt +.ident "desasm.pl" diff --git a/fips/des/fingerprint.sha1 b/fips/des/fingerprint.sha1 index d5d8654723..1a26e57a0f 100644 --- a/fips/des/fingerprint.sha1 +++ b/fips/des/fingerprint.sha1 @@ -1,4 +1,5 @@ HMAC-SHA1(fips_des_enc.c)= ea89417ba58c148c3d72d29438cd0bedc2315f7f +HMAC-SHA1(asm/fips-dx86-elf.s)= 2f85e8e86806c92ee4c12cf5354e19eccf6ed47d HMAC-SHA1(fips_des_selftest.c)= 65498d95dcb502f6b506dd8804771c3d0de17f81 HMAC-SHA1(fips_set_key.c)= e55cabd0cbe5cd17710e11270d9594c0d7237064 HMAC-SHA1(fips_des_locl.h)= 7053848e884df47f06de9f2248380b92e58ef4e5 diff --git a/fips/fips_make_sha1 b/fips/fips_make_sha1 index 8e302bd9ab..e7ccd7759e 100755 --- a/fips/fips_make_sha1 +++ b/fips/fips_make_sha1 @@ -21,7 +21,7 @@ cd ../dsa $S fips_dsa_ossl.c fips_dsa_gen.c fips_dsa_selftest.c > fingerprint.sha1 cd ../des -$S fips_des_enc.c fips_des_selftest.c fips_set_key.c fips_des_locl.h > fingerprint.sha1 +$S fips_des_enc.c asm/fips-dx86-elf.s fips_des_selftest.c fips_set_key.c fips_des_locl.h > fingerprint.sha1 cd ../rsa $S fips_rsa_eay.c fips_rsa_gen.c fips_rsa_selftest.c > fingerprint.sha1 -- 2.25.1