Move ec_asm_src file information to build.info files
authorRichard Levitte <levitte@openssl.org>
Sun, 16 Jun 2019 17:57:52 +0000 (19:57 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 17 Jun 2019 14:08:52 +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
Configurations/README
Configure
crypto/ec/build.info

index 4b143227008a584effcf7c2a7ae204e90df51152..d3a78c0850d2411e60832e9b04fa3fd44dfbb905 100644 (file)
@@ -14,7 +14,6 @@ my %targets=(
        thread_scheme   => "(unknown)", # Assume we don't know
        thread_defines  => [],
 
-       ec_asm_src      => "",
        des_asm_src     => "des_enc.c fcrypt_b.c",
        aes_asm_src     => "aes_core.c aes_cbc.c",
        bf_asm_src      => "bf_enc.c",
@@ -166,7 +165,6 @@ my %targets=(
 
     x86_asm => {
        template        => 1,
-       ec_asm_src      => "ecp_nistz256.c ecp_nistz256-x86.s",
        des_asm_src     => "des-586.s crypt586.s",
        aes_asm_src     => "aes-586.s vpaes-x86.s aesni-x86.s",
        bf_asm_src      => "bf-586.s",
@@ -189,7 +187,6 @@ my %targets=(
     },
     x86_64_asm => {
        template        => 1,
-       ec_asm_src      => "ecp_nistz256.c ecp_nistz256-x86_64.s x25519-x86_64.s",
        aes_asm_src     => "aes-x86_64.s vpaes-x86_64.s bsaes-x86_64.s aesni-x86_64.s aesni-sha1-x86_64.s aesni-sha256-x86_64.s aesni-mb-x86_64.s",
        md5_asm_src     => "md5-x86_64.s",
        sha1_asm_src    => "sha1-x86_64.s sha256-x86_64.s sha512-x86_64.s sha1-mb-x86_64.s sha256-mb-x86_64.s",
@@ -212,7 +209,6 @@ my %targets=(
     },
     sparcv9_asm => {
        template        => 1,
-       ec_asm_src      => "ecp_nistz256.c ecp_nistz256-sparcv9.S",
        des_asm_src     => "des_enc-sparc.S fcrypt_b.c dest4-sparcv9.S",
        aes_asm_src     => "aes_core.c aes_cbc.c aes-sparcv9.S aest4-sparcv9.S aesfx-sparcv9.S",
        md5_asm_src     => "md5-sparcv9.S",
@@ -253,7 +249,6 @@ my %targets=(
     },
     armv4_asm => {
        template        => 1,
-       ec_asm_src      => "ecp_nistz256.c ecp_nistz256-armv4.S",
        aes_asm_src     => "aes_cbc.c aes-armv4.S bsaes-armv7.S aesv8-armx.S",
        sha1_asm_src    => "sha1-armv4-large.S sha256-armv4.S sha512-armv4.S",
        modes_asm_src   => "ghash-armv4.S ghashv8-armx.S",
@@ -263,7 +258,6 @@ my %targets=(
     },
     aarch64_asm => {
        template        => 1,
-       ec_asm_src      => "ecp_nistz256.c ecp_nistz256-armv8.S",
        aes_asm_src     => "aes_core.c aes_cbc.c aesv8-armx.S vpaes-armv8.S",
        sha1_asm_src    => "sha1-armv8.S sha256-armv8.S sha512-armv8.S",
        modes_asm_src   => "ghashv8-armx.S",
@@ -293,7 +287,6 @@ my %targets=(
     ppc64_asm => {
        inherit_from    => [ "ppc32_asm" ],
        template        => 1,
-       ec_asm_src      => "ecp_nistz256.c ecp_nistz256-ppc64.s x25519-ppc64.s",
        keccak1600_asm_src      => "keccak1600-ppc64.s",
     },
 );
index a75c9d33a6db6ee9b6fa84a25f52ba8a87bea059..f5be5a8d6569110abc97d6abf835e7594d0de6dd 100644 (file)
@@ -240,8 +240,6 @@ In each table entry, the following keys are significant:
                                                 export vars as
                                                 accessor functions.
 
-        ec_asm_src      => Assembler implementation of core EC
-                           functions.
         des_asm_src     => Assembler implementation of core DES
                            encryption functions.
                            Defaults to 'des_enc.c fcrypt_b.c'
index e3132d40d9bdf454548a61f41c1855ec29fc2d1d..64bb655f5271c2404b1d8cc40d3d8b873ce92290 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -1458,12 +1458,6 @@ unless ($disabled{asm}) {
     if ($target{modes_asm_src} =~ /ghash-/) {
         push @{$config{lib_defines}}, "GHASH_ASM";
     }
-    if ($target{ec_asm_src} =~ /ecp_nistz256/) {
-        push @{$config{lib_defines}}, "ECP_NISTZ256_ASM";
-    }
-    if ($target{ec_asm_src} =~ /x25519/) {
-        push @{$config{lib_defines}}, "X25519_ASM";
-    }
     if ($target{padlock_asm_src} ne $table{DEFAULTS}->{padlock_asm_src}) {
         push @{$config{dso_defines}}, "PADLOCK_ASM";
     }
@@ -3398,7 +3392,6 @@ sub print_table_entry
         "loutflag",
         "ex_libs",
         "bn_ops",
-        "ec_asm_src",
         "des_asm_src",
         "aes_asm_src",
         "bf_asm_src",
index dd1c891e1958ca86d875d00f53f7aa873208b8c3..5e9778d3332cb8c3e587341a9f9f7d36366c1de4 100644 (file)
@@ -1,3 +1,47 @@
+$ECASM=
+IF[{- !$disabled{asm} -}]
+  $ECASM_x86=ecp_nistz256.c ecp_nistz256-x86.s
+  $ECDEF_x86=ECP_NISTZ256_ASM
+
+  $ECASM_x86_64=ecp_nistz256.c ecp_nistz256-x86_64.s x25519-x86_64.s
+  $ECDEF_x86_64=ECP_NISTZ256_ASM X25519_ASM
+
+  $ECASM_ia64=
+
+  $ECASM_sparcv9=ecp_nistz256.c ecp_nistz256-sparcv9.S
+  $ECDEF_sparcv9=ECP_NISTZ256_ASM
+
+  $ECASM_sparcv8=
+
+  $ECASM_alpha=
+
+  $ECASM_mips32=
+  $ECASM_mips64=
+
+  $ECASM_s390x=
+
+  $ECASM_armv4=ecp_nistz256.c ecp_nistz256-armv4.S
+  $ECDEF_armv4=ECP_NISTZ256_ASM
+  $ECASM_aarch64=ecp_nistz256.c ecp_nistz256-armv8.S
+  $ECDEF_aarch64=ECP_NISTZ256_ASM
+
+  $ECASM_parisc11=
+  $ECASM_parisc20_64=
+
+  $ECASM_ppc32=
+  $ECASM_ppc64=ecp_nistz256.c ecp_nistz256-ppc64.s x25519-ppc64.s
+  $ECDEF_ppc64=ECP_NISTZ256_ASM X25519_ASM
+
+  $ECASM_c64xplus=
+
+  # Now that we have defined all the arch specific variables, use the
+  # appropriate one, and define the appropriate macros
+  IF[$ECASM_{- $target{asm_arch} -}]
+    $ECASM=$ECASM_{- $target{asm_arch} -}
+    $ECDEF=$ECDEF_{- $target{asm_arch} -}
+  ENDIF
+ENDIF
+
 LIBS=../../libcrypto
 SOURCE[../../libcrypto]=\
         ec_lib.c ecp_smpl.c ecp_mont.c ecp_nist.c ec_cvt.c ec_mult.c \
@@ -8,7 +52,8 @@ SOURCE[../../libcrypto]=\
         ecdsa_ossl.c ecdsa_sign.c ecdsa_vrf.c curve25519.c ecx_meth.c \
         curve448/arch_32/f_impl.c curve448/f_generic.c curve448/scalar.c \
         curve448/curve448_tables.c curve448/eddsa.c curve448/curve448.c \
-        {- $target{ec_asm_src} -}
+        $ECASM
+DEFINE[../../libcrypto]=$ECDEF
 
 GENERATE[ecp_nistz256-x86.s]=asm/ecp_nistz256-x86.pl \
         $(PERLASM_SCHEME) $(LIB_CFLAGS) $(LIB_CPPFLAGS) $(PROCESSOR)