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/mips64/Makefile.inc | 7 ++++++- src/lib/libcrypto/arch/mips64/crypto_arch.h | 8 +++++--- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'src/lib/libcrypto/arch/mips64') diff --git a/src/lib/libcrypto/arch/mips64/Makefile.inc b/src/lib/libcrypto/arch/mips64/Makefile.inc index 27de78bb50..f82d0dc59a 100644 --- a/src/lib/libcrypto/arch/mips64/Makefile.inc +++ b/src/lib/libcrypto/arch/mips64/Makefile.inc @@ -1,14 +1,19 @@ -# $OpenBSD: Makefile.inc,v 1.20 2026/01/17 13:55:30 jsing Exp $ +# $OpenBSD: Makefile.inc,v 1.21 2026/01/17 16:18:32 jsing Exp $ # mips64-specific libcrypto build rules # aes +CFLAGS+= -DLIBRESSL_USE_AES_ASSEMBLY SSLASM+= aes aes-mips aes-mips + # bn +CFLAGS+= -DLIBRESSL_USE_BN_ASSEMBLY SSLASM+= bn mips bn-mips SSLASM+= bn mips-mont mips-mont CFLAGS+= -DOPENSSL_BN_ASM_MONT + # sha +CFLAGS+= -DLIBRESSL_USE_SHA_ASSEMBLY SSLASM+= sha sha1-mips sha1-mips SSLASM+= sha sha512-mips sha256-mips SSLASM+= sha sha512-mips sha512-mips diff --git a/src/lib/libcrypto/arch/mips64/crypto_arch.h b/src/lib/libcrypto/arch/mips64/crypto_arch.h index 07d7829fe3..156311837f 100644 --- a/src/lib/libcrypto/arch/mips64/crypto_arch.h +++ b/src/lib/libcrypto/arch/mips64/crypto_arch.h @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto_arch.h,v 1.2 2025/02/14 12:01:58 jsing Exp $ */ +/* $OpenBSD: crypto_arch.h,v 1.3 2026/01/17 16:18:32 jsing Exp $ */ /* * Copyright (c) 2024 Joel Sing * @@ -20,19 +20,21 @@ #ifndef OPENSSL_NO_ASM +#ifdef LIBRESSL_USE_AES_ASSEMBLY #define HAVE_AES_SET_ENCRYPT_KEY_INTERNAL #define HAVE_AES_SET_DECRYPT_KEY_INTERNAL #define HAVE_AES_ENCRYPT_INTERNAL #define HAVE_AES_DECRYPT_INTERNAL +#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 - #define HAVE_SHA512_BLOCK_DATA_ORDER #define HAVE_SHA512_BLOCK_GENERIC +#endif #endif -- cgit v1.2.3-55-g6feb