Browse Source

Move keccak1600_asm_src file information to build.info files

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9166)
Richard Levitte 4 years ago
parent
commit
8c0098a8de
3 changed files with 23 additions and 13 deletions
  1. 0 6
      Configurations/00-base-templates.conf
  2. 0 3
      Configure
  3. 23 4
      crypto/sha/build.info

+ 0 - 6
Configurations/00-base-templates.conf

@@ -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",
     },
 );

+ 0 - 3
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";
     }

+ 23 - 4
crypto/sha/build.info

@@ -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)