From ed26604a717ca6e028ec12ae896603a96c66e2b2 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Fri, 16 Dec 2005 12:55:33 +0000 Subject: [PATCH] Engage Whirlpool assembler and mention Whirlpool in CHANGES. --- CHANGES | 3 +++ Configure | 14 ++++++++++---- Makefile.org | 2 ++ crypto/whrlpool/Makefile | 11 +++++++---- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 32ad840116..eae69d3e37 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,9 @@ Changes between 0.9.8a and 0.9.9 [xx XXX xxxx] + *) Whirlpool hash implementation is added. + [Andy Polyakov] + *) BIGNUM code on 64-bit SPARCv9 targets is switched from bn(64,64) to bn(64,32). Because of instruction set limitations it doesn't have any negative impact on performance. This was done mostly in order diff --git a/Configure b/Configure index c11fab8e2e..bbae9641e8 100755 --- a/Configure +++ b/Configure @@ -114,11 +114,11 @@ my $tlib="-lnsl -lsocket"; my $bits1="THIRTY_TWO_BIT "; my $bits2="SIXTY_FOUR_BIT "; -my $x86_elf_asm="x86cpuid-elf.o:bn86-elf.o co86-elf.o mo86-elf.o:dx86-elf.o yx86-elf.o:ax86-elf.o:bx86-elf.o:mx86-elf.o:sx86-elf.o s512sse2-elf.o:cx86-elf.o:rx86-elf.o:rm86-elf.o:r586-elf.o:"; -my $x86_coff_asm="x86cpuid-cof.o:bn86-cof.o co86-cof.o mo86-cof.o:dx86-cof.o yx86-cof.o:ax86-cof.o:bx86-cof.o:mx86-cof.o:sx86-cof.o s512sse2-cof.o:cx86-cof.o:rx86-cof.o:rm86-cof.o:r586-cof.o:"; -my $x86_out_asm="x86cpuid-out.o:bn86-out.o co86-out.o mo86-out.o:dx86-out.o yx86-out.o:ax86-out.o:bx86-out.o:mx86-out.o:sx86-out.o s512sse2-out.o:cx86-out.o:rx86-out.o:rm86-out.o:r586-out.o:"; +my $x86_elf_asm="x86cpuid-elf.o:bn86-elf.o co86-elf.o mo86-elf.o:dx86-elf.o yx86-elf.o:ax86-elf.o:bx86-elf.o:mx86-elf.o:sx86-elf.o s512sse2-elf.o:cx86-elf.o:rx86-elf.o:rm86-elf.o:r586-elf.o:w86mmx-elf.o"; +my $x86_coff_asm="x86cpuid-cof.o:bn86-cof.o co86-cof.o mo86-cof.o:dx86-cof.o yx86-cof.o:ax86-cof.o:bx86-cof.o:mx86-cof.o:sx86-cof.o s512sse2-cof.o:cx86-cof.o:rx86-cof.o:rm86-cof.o:r586-cof.o:w86mmx-cof.o"; +my $x86_out_asm="x86cpuid-out.o:bn86-out.o co86-out.o mo86-out.o:dx86-out.o yx86-out.o:ax86-out.o:bx86-out.o:mx86-out.o:sx86-out.o s512sse2-out.o:cx86-out.o:rx86-out.o:rm86-out.o:r586-out.o:w86mmx-out.o"; -my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o:::"; +my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o:::wp-x86_64.o"; my $ia64_asm="ia64cpuid.o:bn-ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o:::"; my $no_asm=":::::::::::"; @@ -1224,6 +1224,11 @@ if ($aes_obj =~ /\.o$/) else { $aes_obj=$aes_enc; } +if ($wp_obj =~ /\.o$/) + { + if ($wp_obj =~ /mmx/ && $processor eq "386") { $wp_obj=""; } + else { $cflags.=" -DWHIRLPOOL_ASM"; } + } # "Stringify" the C flags string. This permits it to be made part of a string # and works as well on command lines. @@ -1308,6 +1313,7 @@ while () s/^MD5_ASM_OBJ=.*$/MD5_ASM_OBJ= $md5_obj/; s/^SHA1_ASM_OBJ=.*$/SHA1_ASM_OBJ= $sha1_obj/; s/^RMD160_ASM_OBJ=.*$/RMD160_ASM_OBJ= $rmd160_obj/; + s/^WP_ASM_OBJ=.*$/WP_ASM_OBJ= $wp_obj/; s/^PROCESSOR=.*/PROCESSOR= $processor/; s/^RANLIB=.*/RANLIB= $ranlib/; s/^ARFLAGS=.*/ARFLAGS= $arflags/; diff --git a/Makefile.org b/Makefile.org index 01014a8e26..a34033abe0 100644 --- a/Makefile.org +++ b/Makefile.org @@ -95,6 +95,7 @@ RC5_ENC= rc5_enc.o MD5_ASM_OBJ= SHA1_ASM_OBJ= RMD160_ASM_OBJ= +WP_ASM_OBJ= # KRB5 stuff KRB5_INCLUDES= @@ -191,6 +192,7 @@ BUILDENV= PLATFORM='${PLATFORM}' PROCESSOR='${PROCESSOR}' \ SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' \ MD5_ASM_OBJ='${MD5_ASM_OBJ}' \ RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' \ + WP_ASM_OBJ='${WP_ASM_OBJ}' \ THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES= # MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors, # which in turn eliminates ambiguities in variable treatment with -e. diff --git a/crypto/whrlpool/Makefile b/crypto/whrlpool/Makefile index 4d7fa88fb3..a0b07df53a 100644 --- a/crypto/whrlpool/Makefile +++ b/crypto/whrlpool/Makefile @@ -21,7 +21,7 @@ APPS= LIB=$(TOP)/libcrypto.a LIBSRC=wp_dgst.c wp_block.c -LIBOBJ=wp_dgst.o wp_block.o +LIBOBJ=wp_dgst.o wp_block.o $(WP_ASM_OBJ) SRC= $(LIBSRC) @@ -40,13 +40,16 @@ lib: $(LIBOBJ) $(RANLIB) $(LIB) || echo Never mind. @touch lib -x86mmx-elf.s: asm/wp-mmx.pl ../perlasm/x86asm.pl +w86mmx-elf.s: asm/wp-mmx.pl ../perlasm/x86asm.pl (cd asm; $(PERL) wp-mmx.pl elf $(CFLAGS) $(PROCESSOR)) > $@ -x86mmx-cof.s: asm/wp-mmx.pl ../perlasm/x86asm.pl +w86mmx-cof.s: asm/wp-mmx.pl ../perlasm/x86asm.pl (cd asm; $(PERL) wp-mmx.pl coff $(CFLAGS) $(PROCESSOR)) > $@ -x86mmx-out.s: asm/wp-mmx.pl ../perlasm/x86asm.pl +w86mmx-out.s: asm/wp-mmx.pl ../perlasm/x86asm.pl (cd asm; $(PERL) wp-mmx.pl a.out $(CFLAGS) $(PROCESSOR)) > $@ +wp-x86_64.s: asm/wp-x86_64.pl + $(PERL) asm/wp-x86_64.pl $@ + $(LIBOBJ): $(LIBSRC) files: -- 2.25.1