summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/arch/mips64
diff options
context:
space:
mode:
authorjsing <>2026-01-17 16:18:32 +0000
committerjsing <>2026-01-17 16:18:32 +0000
commit03fc8f9b9ecbb65326348dd8eccc5d22344abefe (patch)
tree304533a0e18e53486c5458ff9c69099a939484be /src/lib/libcrypto/arch/mips64
parentfdea186c25361674646de3b0a16b3ad37c8f0ec3 (diff)
downloadopenbsd-03fc8f9b9ecbb65326348dd8eccc5d22344abefe.tar.gz
openbsd-03fc8f9b9ecbb65326348dd8eccc5d22344abefe.tar.bz2
openbsd-03fc8f9b9ecbb65326348dd8eccc5d22344abefe.zip
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@
Diffstat (limited to 'src/lib/libcrypto/arch/mips64')
-rw-r--r--src/lib/libcrypto/arch/mips64/Makefile.inc7
-rw-r--r--src/lib/libcrypto/arch/mips64/crypto_arch.h8
2 files changed, 11 insertions, 4 deletions
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 @@
1# $OpenBSD: Makefile.inc,v 1.20 2026/01/17 13:55:30 jsing Exp $ 1# $OpenBSD: Makefile.inc,v 1.21 2026/01/17 16:18:32 jsing Exp $
2 2
3# mips64-specific libcrypto build rules 3# mips64-specific libcrypto build rules
4 4
5# aes 5# aes
6CFLAGS+= -DLIBRESSL_USE_AES_ASSEMBLY
6SSLASM+= aes aes-mips aes-mips 7SSLASM+= aes aes-mips aes-mips
8
7# bn 9# bn
10CFLAGS+= -DLIBRESSL_USE_BN_ASSEMBLY
8SSLASM+= bn mips bn-mips 11SSLASM+= bn mips bn-mips
9SSLASM+= bn mips-mont mips-mont 12SSLASM+= bn mips-mont mips-mont
10CFLAGS+= -DOPENSSL_BN_ASM_MONT 13CFLAGS+= -DOPENSSL_BN_ASM_MONT
14
11# sha 15# sha
16CFLAGS+= -DLIBRESSL_USE_SHA_ASSEMBLY
12SSLASM+= sha sha1-mips sha1-mips 17SSLASM+= sha sha1-mips sha1-mips
13SSLASM+= sha sha512-mips sha256-mips 18SSLASM+= sha sha512-mips sha256-mips
14SSLASM+= sha sha512-mips sha512-mips 19SSLASM+= 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 @@
1/* $OpenBSD: crypto_arch.h,v 1.2 2025/02/14 12:01:58 jsing Exp $ */ 1/* $OpenBSD: crypto_arch.h,v 1.3 2026/01/17 16:18:32 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2024 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -20,19 +20,21 @@
20 20
21#ifndef OPENSSL_NO_ASM 21#ifndef OPENSSL_NO_ASM
22 22
23#ifdef LIBRESSL_USE_AES_ASSEMBLY
23#define HAVE_AES_SET_ENCRYPT_KEY_INTERNAL 24#define HAVE_AES_SET_ENCRYPT_KEY_INTERNAL
24#define HAVE_AES_SET_DECRYPT_KEY_INTERNAL 25#define HAVE_AES_SET_DECRYPT_KEY_INTERNAL
25#define HAVE_AES_ENCRYPT_INTERNAL 26#define HAVE_AES_ENCRYPT_INTERNAL
26#define HAVE_AES_DECRYPT_INTERNAL 27#define HAVE_AES_DECRYPT_INTERNAL
28#endif
27 29
30#ifdef LIBRESSL_USE_SHA_ASSEMBLY
28#define HAVE_SHA1_BLOCK_DATA_ORDER 31#define HAVE_SHA1_BLOCK_DATA_ORDER
29#define HAVE_SHA1_BLOCK_GENERIC 32#define HAVE_SHA1_BLOCK_GENERIC
30
31#define HAVE_SHA256_BLOCK_DATA_ORDER 33#define HAVE_SHA256_BLOCK_DATA_ORDER
32#define HAVE_SHA256_BLOCK_GENERIC 34#define HAVE_SHA256_BLOCK_GENERIC
33
34#define HAVE_SHA512_BLOCK_DATA_ORDER 35#define HAVE_SHA512_BLOCK_DATA_ORDER
35#define HAVE_SHA512_BLOCK_GENERIC 36#define HAVE_SHA512_BLOCK_GENERIC
37#endif
36 38
37#endif 39#endif
38 40