From a9bb7e9270d26416cc387bc0777c18f9690e2302 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Sun, 16 Jun 2019 22:17:26 +0200 Subject: [PATCH] Move modes_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 | 11 ------ Configurations/10-main.conf | 2 -- Configurations/README | 3 -- Configure | 4 --- crypto/modes/build.info | 52 ++++++++++++++++++++++++++- 5 files changed, 51 insertions(+), 21 deletions(-) diff --git a/Configurations/00-base-templates.conf b/Configurations/00-base-templates.conf index 168d776ba1..5c73ce35ad 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 => [], - modes_asm_src => "", padlock_asm_src => "", chacha_asm_src => "chacha_enc.c", poly1305_asm_src => "", @@ -155,7 +154,6 @@ my %targets=( x86_asm => { template => 1, - modes_asm_src => "ghash-x86.s", padlock_asm_src => "e_padlock-x86.s", chacha_asm_src => "chacha-x86.s", poly1305_asm_src=> "poly1305-x86.s", @@ -166,7 +164,6 @@ my %targets=( }, x86_64_asm => { template => 1, - modes_asm_src => "ghash-x86_64.s aesni-gcm-x86_64.s", padlock_asm_src => "e_padlock-x86_64.s", chacha_asm_src => "chacha-x86_64.s", poly1305_asm_src=> "poly1305-x86_64.s", @@ -174,13 +171,11 @@ my %targets=( }, ia64_asm => { template => 1, - modes_asm_src => "ghash-ia64.s", chacha_asm_src => "chacha-ia64.S", poly1305_asm_src=> "asm/poly1305-ia64.S", }, sparcv9_asm => { template => 1, - modes_asm_src => "ghash-sparcv9.S", poly1305_asm_src=> "poly1305-sparcv9.S", }, sparcv8_asm => { @@ -188,7 +183,6 @@ my %targets=( }, alpha_asm => { template => 1, - modes_asm_src => "ghash-alpha.S", }, mips32_asm => { template => 1, @@ -200,28 +194,24 @@ my %targets=( }, s390x_asm => { template => 1, - modes_asm_src => "ghash-s390x.S", chacha_asm_src => "chacha-s390x.S", poly1305_asm_src=> "poly1305-s390x.S", keccak1600_asm_src => "keccak1600-s390x.S", }, armv4_asm => { template => 1, - modes_asm_src => "ghash-armv4.S ghashv8-armx.S", chacha_asm_src => "chacha-armv4.S", poly1305_asm_src=> "poly1305-armv4.S", keccak1600_asm_src => "keccak1600-armv4.S", }, aarch64_asm => { template => 1, - modes_asm_src => "ghashv8-armx.S", chacha_asm_src => "chacha-armv8.S", poly1305_asm_src=> "poly1305-armv8.S", keccak1600_asm_src => "keccak1600-armv8.S", }, parisc11_asm => { template => 1, - modes_asm_src => "ghash-parisc.s", }, parisc20_64_asm => { template => 1, @@ -229,7 +219,6 @@ my %targets=( }, ppc32_asm => { template => 1, - modes_asm_src => "ghashp8-ppc.s", chacha_asm_src => "chacha-ppc.s", poly1305_asm_src=> "poly1305-ppc.s poly1305-ppcfp.s", }, diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf index 2895eef4fe..450fe0dcb8 100644 --- a/Configurations/10-main.conf +++ b/Configurations/10-main.conf @@ -949,7 +949,6 @@ my %targets = ( cppflags => combine("-DOPENSSL_SMALL_FOOTPRINT", threads("-D_REENTRANT")), bn_ops => "BN_LLONG", - modes_asm_src => "ghash-c64xplus.s", chacha_asm_src => "chacha-c64xplus.s", poly1305_asm_src => "poly1305-c64xplus.s", thread_scheme => "pthreads", @@ -1852,7 +1851,6 @@ my %targets = ( perlasm_scheme => 'ias', pointer_size => "", - modes_asm_src => "", # Because ghash-ia64.s doesn't work on VMS }, "vms-ia64-p32" => { inherit_from => [ "vms-ia64" ], diff --git a/Configurations/README b/Configurations/README index 664e8d86bd..84e7b20c7d 100644 --- a/Configurations/README +++ b/Configurations/README @@ -240,9 +240,6 @@ In each table entry, the following keys are significant: export vars as accessor functions. - modes_asm_src => Assembler implementation of cipher modes, - currently the functions gcm_gmult_4bit and - gcm_ghash_4bit. padlock_asm_src => Assembler implementation of core parts of the padlock engine. This is mandatory on any platform where the padlock engine might diff --git a/Configure b/Configure index 3a8ba0cd6b..c88cd45899 100755 --- a/Configure +++ b/Configure @@ -1407,9 +1407,6 @@ unless ($disabled{asm}) { if ($target{keccak1600_asm_src} ne $table{DEFAULTS}->{keccak1600_asm_src}) { push @{$config{lib_defines}}, "KECCAK1600_ASM"; } - if ($target{modes_asm_src} =~ /ghash-/) { - push @{$config{lib_defines}}, "GHASH_ASM"; - } if ($target{padlock_asm_src} ne $table{DEFAULTS}->{padlock_asm_src}) { push @{$config{dso_defines}}, "PADLOCK_ASM"; } @@ -3344,7 +3341,6 @@ sub print_table_entry "loutflag", "ex_libs", "bn_ops", - "modes_asm_src", "padlock_asm_src", "chacha_asm_src", "poly1035_asm_src", diff --git a/crypto/modes/build.info b/crypto/modes/build.info index 4157af3ff9..6024606a54 100644 --- a/crypto/modes/build.info +++ b/crypto/modes/build.info @@ -1,9 +1,59 @@ LIBS=../../libcrypto -$COMMON=cbc128.c ctr128.c cfb128.c ofb128.c {- $target{modes_asm_src} -} +$MODESASM= +IF[{- !$disabled{asm} -}] + $MODESASM_x86=ghash-x86.s + $MODESDEF_x86=GHASH_ASM + $MODESASM_x86_64=ghash-x86_64.s aesni-gcm-x86_64.s + $MODESDEF_x86_64=GHASH_ASM + + # ghash-ia64.s doesn't work on VMS + IF[{- $config{target} !~ /^vms-/ -}] + $MODESASM_ia64=ghash-ia64.s + $MODESDEF_ia64=GHASH_ASM + ENDIF + + $MODESASM_sparcv9=ghash-sparcv9.S + $MODESDEF_sparcv9=GHASH_ASM + + $MODESASM_alpha=ghash-alpha.S + $MODESDEF_alpha=GHASH_ASM + + $MODESASM_s390x=ghash-s390x.S + $MODESDEF_s390x=GHASH_ASM + + $MODESASM_armv4=ghash-armv4.S ghashv8-armx.S + $MODESDEF_armv4=GHASH_ASM + $MODESASM_aarch64=ghashv8-armx.S + $MODESDEF_aarch64=GHASH_ASM + + $MODESASM_parisc11=ghash-parisc.s + $MODESDEF_parisc11=GHASH_ASM + $MODESASM_parisc20_64=$MODESASM_parisc11 + $MODESDEF_parisc20_64=$MODESDEF_parisc11 + + $MODESASM_ppc32=ghashp8-ppc.s + $MODESDEF_ppc32= + $MODESASM_ppc64=$MODESASM_ppc32 + $MODESDEF_ppc64=$MODESDEF_ppc32 + + $MODESASM_c64xplus=ghash-c64xplus.s + $MODESDEF_c64xplus=GHASH_ASM + + # Now that we have defined all the arch specific variables, use the + # appropriate one, and define the appropriate macros + IF[$MODESASM_{- $target{asm_arch} -}] + $MODESASM=$MODESASM_{- $target{asm_arch} -} + $MODESDEF=$MODESDEF_{- $target{asm_arch} -} + ENDIF +ENDIF + +$COMMON=cbc128.c ctr128.c cfb128.c ofb128.c $MODESASM SOURCE[../../libcrypto]=$COMMON \ cts128.c gcm128.c ccm128.c xts128.c wrap128.c ocb128.c siv128.c +DEFINE[../../libcrypto]=$MODESDEF SOURCE[../../providers/fips]=$COMMON +DEFINE[../../providers/fips]=$MODESDEF INCLUDE[gcm128.o]=.. -- 2.25.1