]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
don't use asm accelerated path on big endian power9
authorNeil Horman <nhorman@openssl.org>
Mon, 9 Feb 2026 17:55:50 +0000 (12:55 -0500)
committerNeil Horman <nhorman@openssl.org>
Tue, 17 Feb 2026 14:11:43 +0000 (09:11 -0500)
https://github.com/openssl/openssl/issues/29845

Found that our hardware accelerated path doesn't work on big endian
systems, so make sure that we only use it when little endian is defined

We also noted that PPC_AES_GCM_CAPABLE gets defined to zero when the
capabilities register notes that the hardware isn't capable of the
needed instructions, but that still includes the asm path as
PPC_AES_GCM_CAPABLE is still defined.

Fix both issues

Fixes #29845

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
MergeDate: Tue Feb 17 14:11:46 2026
(Merged from https://github.com/openssl/openssl/pull/29968)

include/crypto/aes_platform.h

index 496b08f46d5ce447227c83b590e8d1dc5fc6c1b8..95d13d22e191bb4d28263582866b659c90d76963 100644 (file)
@@ -77,7 +77,9 @@ void AES_xts_decrypt(const unsigned char *inp, unsigned char *out, size_t len,
 #define HWAES_xts_decrypt aes_p8_xts_decrypt
 #endif /* OPENSSL_SYS_MACOSX */
 #if !defined(OPENSSL_SYS_AIX) && !defined(OPENSSL_SYS_MACOSX)
+#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
 #define PPC_AES_GCM_CAPABLE (OPENSSL_ppccap_P & PPC_MADD300)
+#endif
 #define AES_GCM_ENC_BYTES 128
 #define AES_GCM_DEC_BYTES 128
 size_t ppc_aes_gcm_encrypt(const unsigned char *in, unsigned char *out,