From 03fc8f9b9ecbb65326348dd8eccc5d22344abefe Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sat, 17 Jan 2026 16:18:32 +0000 Subject: Provide LIBRESSL_USE_.*_ASSEMBLY defines. Make life easier for portable by providing LIBRESSL_USE_.*_ASSEMBLY defines, which enable/disable assembly for a specific algorithm. This means that selected platforms can include the assembly files and specify a define, rather than having to try to patch the crypto_arch.h headers. Discussed with tb@ --- src/lib/libcrypto/arch/hppa/Makefile.inc | 9 ++++++++- src/lib/libcrypto/arch/hppa/crypto_arch.h | 9 +++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src/lib/libcrypto/arch/hppa') diff --git a/src/lib/libcrypto/arch/hppa/Makefile.inc b/src/lib/libcrypto/arch/hppa/Makefile.inc index 4244c20fef..c18e68d21c 100644 --- a/src/lib/libcrypto/arch/hppa/Makefile.inc +++ b/src/lib/libcrypto/arch/hppa/Makefile.inc @@ -1,15 +1,22 @@ -# $OpenBSD: Makefile.inc,v 1.29 2026/01/17 14:30:37 jsing Exp $ +# $OpenBSD: Makefile.inc,v 1.30 2026/01/17 16:18:32 jsing Exp $ # hppa-specific libcrypto build rules # aes +CFLAGS+= -DLIBRESSL_USE_AES_ASSEMBLY SSLASM+= aes aes-parisc aes-parisc + # bn +CFLAGS+= -DLIBRESSL_USE_BN_ASSEMBLY SSLASM+= bn parisc-mont parisc-mont CFLAGS+= -DOPENSSL_BN_ASM_MONT + # modes +CFLAGS+= -DLIBRESSL_USE_GCM_ASSEMBLY SSLASM+= modes ghash-parisc ghash-parisc + # sha +CFLAGS+= -DLIBRESSL_USE_SHA_ASSEMBLY SSLASM+= sha sha1-parisc sha1-parisc SSLASM+= sha sha512-parisc sha256-parisc diff --git a/src/lib/libcrypto/arch/hppa/crypto_arch.h b/src/lib/libcrypto/arch/hppa/crypto_arch.h index 80260c93e7..f1e7d2dcbf 100644 --- a/src/lib/libcrypto/arch/hppa/crypto_arch.h +++ b/src/lib/libcrypto/arch/hppa/crypto_arch.h @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto_arch.h,v 1.3 2026/01/17 14:30:37 jsing Exp $ */ +/* $OpenBSD: crypto_arch.h,v 1.4 2026/01/17 16:18:32 jsing Exp $ */ /* * Copyright (c) 2024 Joel Sing * @@ -20,17 +20,22 @@ #ifndef OPENSSL_NO_ASM +#ifdef LIBRESSL_USE_AES_ASSEMBLY #define HAVE_AES_ENCRYPT_INTERNAL #define HAVE_AES_DECRYPT_INTERNAL +#endif +#ifdef LIBRESSL_USE_GCM_ASSEMBLY #define HAVE_GCM_GHASH_4BIT #define HAVE_GCM_GMULT_4BIT +#endif +#ifdef LIBRESSL_USE_SHA_ASSEMBLY #define HAVE_SHA1_BLOCK_DATA_ORDER #define HAVE_SHA1_BLOCK_GENERIC - #define HAVE_SHA256_BLOCK_DATA_ORDER #define HAVE_SHA256_BLOCK_GENERIC +#endif #endif -- cgit v1.2.3-55-g6feb