From aa76ff26ce1d1f5404794c7529b419f3de8e06ae Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Sun, 16 Jun 2019 19:57:52 +0200 Subject: [PATCH] Move ec_asm_src file information to build.info files Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/9166) --- Configurations/00-base-templates.conf | 7 ---- Configurations/README | 2 -- Configure | 7 ---- crypto/ec/build.info | 47 ++++++++++++++++++++++++++- 4 files changed, 46 insertions(+), 17 deletions(-) diff --git a/Configurations/00-base-templates.conf b/Configurations/00-base-templates.conf index 4b14322700..d3a78c0850 100644 --- a/Configurations/00-base-templates.conf +++ b/Configurations/00-base-templates.conf @@ -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", }, ); diff --git a/Configurations/README b/Configurations/README index a75c9d33a6..f5be5a8d65 100644 --- a/Configurations/README +++ b/Configurations/README @@ -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' diff --git a/Configure b/Configure index e3132d40d9..64bb655f52 100755 --- 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", diff --git a/crypto/ec/build.info b/crypto/ec/build.info index dd1c891e19..5e9778d333 100644 --- a/crypto/ec/build.info +++ b/crypto/ec/build.info @@ -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) -- 2.25.1