Move keccak1600_asm_src file information to build.info files
authorRichard Levitte <levitte@openssl.org>
Sun, 16 Jun 2019 20:34:09 +0000 (22:34 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 17 Jun 2019 14:08:53 +0000 (16:08 +0200)
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9166)

Configurations/00-base-templates.conf
Configure
crypto/sha/build.info

index edc176241e18f9781e477985e9c6377c374ed1aa..14b7608ca53eb77be4dc9a7a607c49b4294fead4 100644 (file)
@@ -15,7 +15,6 @@ my %targets=(
        thread_defines  => [],
 
        padlock_asm_src => "",
-       keccak1600_asm_src      => "keccak1600.c",
 
        unistd          => "<unistd.h>",
        shared_target   => "",
@@ -161,7 +160,6 @@ my %targets=(
     x86_64_asm => {
        template        => 1,
        padlock_asm_src => "e_padlock-x86_64.s",
-       keccak1600_asm_src      => "keccak1600-x86_64.s",
     },
     ia64_asm => {
        template        => 1,
@@ -184,15 +182,12 @@ my %targets=(
     },
     s390x_asm => {
        template        => 1,
-       keccak1600_asm_src      => "keccak1600-s390x.S",
     },
     armv4_asm => {
        template        => 1,
-       keccak1600_asm_src      => "keccak1600-armv4.S",
     },
     aarch64_asm => {
        template        => 1,
-       keccak1600_asm_src      => "keccak1600-armv8.S",
     },
     parisc11_asm => {
        template        => 1,
@@ -207,6 +202,5 @@ my %targets=(
     ppc64_asm => {
        inherit_from    => [ "ppc32_asm" ],
        template        => 1,
-       keccak1600_asm_src      => "keccak1600-ppc64.s",
     },
 );
index 7ec44a3c2bcf03a2158fd6076d7e9e0373000c18..dd8c595b65ec7b22480ab93b2083abd4bc5eb576 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -1404,9 +1404,6 @@ if ($target{sys_id} ne "")
         }
 
 unless ($disabled{asm}) {
-    if ($target{keccak1600_asm_src} ne $table{DEFAULTS}->{keccak1600_asm_src}) {
-        push @{$config{lib_defines}}, "KECCAK1600_ASM";
-    }
     if ($target{padlock_asm_src} ne $table{DEFAULTS}->{padlock_asm_src}) {
         push @{$config{dso_defines}}, "PADLOCK_ASM";
     }
index c9ade6e5223965c48054bc56860e0f37ab20f7bd..187d0c495acefb49487a7cbad05ad64d74e1af5b 100644 (file)
@@ -53,12 +53,31 @@ IF[{- !$disabled{asm} -}]
   ENDIF
 ENDIF
 
-$COMMON=sha1dgst.c sha256.c sha512.c sha3.c $SHA1ASM \
-        {- $target{keccak1600_asm_src} -}
+$KECCAK1600ASM=keccak1600.c
+IF[{- !$disabled{asm} -}]
+  $KECCAK1600ASM_x86=
+  $KECCAK1600ASM_x86_64=keccak1600-x86_64.s
+
+  $KECCAK1600ASM_s390x=keccak1600-s390x.S
+
+  $KECCAK1600ASM_armv4=keccak1600-armv4.S
+  $KECCAK1600ASM_aarch64=keccak1600-armv8.S
+
+  $KECCAK1600ASM_ppc64=keccak1600-ppc64.s
+
+  # Now that we have defined all the arch specific variables, use the
+  # appropriate one, and define the appropriate macros
+  IF[$KECCAK1600ASM_{- $target{asm_arch} -}]
+    $KECCAK1600ASM=$KECCAK1600ASM_{- $target{asm_arch} -}
+    $KECCAK1600DEF=KECCAK1600_ASM
+  ENDIF
+ENDIF
+
+$COMMON=sha1dgst.c sha256.c sha512.c sha3.c $SHA1ASM $KECCAK1600ASM
 SOURCE[../../libcrypto]=$COMMON sha1_one.c
-DEFINE[../../libcrypto]=$SHA1DEF
+DEFINE[../../libcrypto]=$SHA1DEF $KECCAK1600DEF
 SOURCE[../../providers/fips]= $COMMON
-DEFINE[../../providers/fips]= $SHA1DEF
+DEFINE[../../providers/fips]= $SHA1DEF $KECCAK1600DEF
 
 GENERATE[sha1-586.s]=asm/sha1-586.pl \
         $(PERLASM_SCHEME) $(LIB_CFLAGS) $(LIB_CPPFLAGS) $(PROCESSOR)