aes_platform.h, gcm128.c: fix Darwin PowerPC macro to include ppc64
authorbarracuda156 <vital.had@gmail.com>
Tue, 9 Jan 2024 22:35:33 +0000 (06:35 +0800)
committerTomas Mraz <tomas@openssl.org>
Fri, 12 Jan 2024 18:33:33 +0000 (19:33 +0100)
Current PowerPC-related defines omit Darwin ppc64 case.
Use __POWERPC__ in place of __ppc__ + __ppc64__
Fixes #23220

CLA: trivial

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23245)

crypto/modes/gcm128.c
include/crypto/aes_platform.h

index 6f293ef7944d30432f82eba4cce75c5924b44ab3..de9137c927876721d09f8b0a211be32f6c4f947c 100644 (file)
@@ -393,7 +393,7 @@ void gcm_init_vis3(u128 Htable[16], const u64 Xi[2]);
 void gcm_gmult_vis3(u64 Xi[2], const u128 Htable[16]);
 void gcm_ghash_vis3(u64 Xi[2], const u128 Htable[16], const u8 *inp,
                     size_t len);
-# elif defined(OPENSSL_CPUID_OBJ) && (defined(__powerpc__) || defined(__ppc__) || defined(_ARCH_PPC))
+# elif defined(OPENSSL_CPUID_OBJ) && (defined(__powerpc__) || defined(__POWERPC__) || defined(_ARCH_PPC))
 #  include "crypto/ppc_arch.h"
 #  define GHASH_ASM_PPC
 void gcm_init_p8(u128 Htable[16], const u64 Xi[2]);
index 51fc5ba2111c6a050277d91eca3a36a8f84c87ce..cf4a94b86edf01715b872280abaa50d6b572d49a 100644 (file)
@@ -60,7 +60,7 @@ void AES_xts_decrypt(const unsigned char *inp, unsigned char *out, size_t len,
 # endif /* AES_XTS_ASM */
 
 # if defined(OPENSSL_CPUID_OBJ)
-#  if (defined(__powerpc__) || defined(__ppc__) || defined(_ARCH_PPC))
+#  if (defined(__powerpc__) || defined(__POWERPC__) || defined(_ARCH_PPC))
 #   include "crypto/ppc_arch.h"
 #   ifdef VPAES_ASM
 #    define VPAES_CAPABLE (OPENSSL_ppccap_P & PPC_ALTIVEC)