From: Tomas Mraz Date: Thu, 8 Dec 2022 16:26:19 +0000 (+0100) Subject: Do not build P10-specific Chacha20 assembler on AIX X-Git-Tag: openssl-3.2.0-alpha1~1586 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abfc152126616d6f7c1cb1b9cbe8def9f18a1a96;p=thirdparty%2Fopenssl.git Do not build P10-specific Chacha20 assembler on AIX Fixes #18145 Reviewed-by: Paul Dale Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/19865) (cherry picked from commit cdcc439aa0acba8a50b5e3444fb12d6e1157b991) --- diff --git a/crypto/chacha/build.info b/crypto/chacha/build.info index d0400db24d1..b8c0a7870bc 100644 --- a/crypto/chacha/build.info +++ b/crypto/chacha/build.info @@ -12,7 +12,10 @@ IF[{- !$disabled{asm} -}] $CHACHAASM_armv4=chacha-armv4.S $CHACHAASM_aarch64=chacha-armv8.S chacha-armv8-sve.S - $CHACHAASM_ppc32=chacha_ppc.c chacha-ppc.s chachap10-ppc.s + $CHACHAASM_ppc32=chacha_ppc.c chacha-ppc.s + IF[{- $target{sys_id} ne "AIX" -}] + $CHACHAASM_ppc32=chacha_ppc.c chacha-ppc.s chachap10-ppc.s + ENDIF $CHACHAASM_ppc64=$CHACHAASM_ppc32 $CHACHAASM_c64xplus=chacha-c64xplus.s diff --git a/crypto/chacha/chacha_ppc.c b/crypto/chacha/chacha_ppc.c index 94355984524..05d8cf100df 100644 --- a/crypto/chacha/chacha_ppc.c +++ b/crypto/chacha/chacha_ppc.c @@ -30,9 +30,11 @@ void ChaCha20_ctr32(unsigned char *out, const unsigned char *inp, size_t len, const unsigned int key[8], const unsigned int counter[4]) { +#ifndef OPENSSL_SYS_AIX OPENSSL_ppccap_P & PPC_BRD31 - ? ChaCha20_ctr32_vsx_p10(out, inp, len, key, counter) - :OPENSSL_ppccap_P & PPC_CRYPTO207 + ? ChaCha20_ctr32_vsx_p10(out, inp, len, key, counter) : +#endif + OPENSSL_ppccap_P & PPC_CRYPTO207 ? ChaCha20_ctr32_vsx(out, inp, len, key, counter) : OPENSSL_ppccap_P & PPC_ALTIVEC ? ChaCha20_ctr32_vmx(out, inp, len, key, counter)