summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/arch/sparc64
diff options
context:
space:
mode:
authorjsing <>2025-02-14 12:01:58 +0000
committerjsing <>2025-02-14 12:01:58 +0000
commit55a1827d4b1706532809a68f02c30336000e01a9 (patch)
tree606af9a8caef4eada19e055b0a35e755d199b0d1 /src/lib/libcrypto/arch/sparc64
parentaee4d44b17e8fc57dfaadf57efabb128712c9f72 (diff)
downloadopenbsd-55a1827d4b1706532809a68f02c30336000e01a9.tar.gz
openbsd-55a1827d4b1706532809a68f02c30336000e01a9.tar.bz2
openbsd-55a1827d4b1706532809a68f02c30336000e01a9.zip
Replace Makefile based SHA*_ASM defines with HAVE_SHA_* defines.
Currently, SHA{1,256,512}_ASM defines are used to remove the C implementation of sha{1,256,512}_block_data_order() when it is provided by assembly. However, this prevents the C implementation from being used as a fallback. Rename the C sha*_block_data_order() to sha*_block_generic() and provide a sha*_block_data_order() that calls sha*_block_generic(). Replace the Makefile based SHA*_ASM defines with two HAVE_SHA_* defines that allow these functions to be compiled in or removed, such that machine specific verisons can be provided. This should effectively be a no-op on any platform that defined SHA{1,256,512}_ASM. ok tb@
Diffstat (limited to 'src/lib/libcrypto/arch/sparc64')
-rw-r--r--src/lib/libcrypto/arch/sparc64/Makefile.inc5
-rw-r--r--src/lib/libcrypto/arch/sparc64/crypto_arch.h11
2 files changed, 11 insertions, 5 deletions
diff --git a/src/lib/libcrypto/arch/sparc64/Makefile.inc b/src/lib/libcrypto/arch/sparc64/Makefile.inc
index 43b4b199cd..cbf63e033e 100644
--- a/src/lib/libcrypto/arch/sparc64/Makefile.inc
+++ b/src/lib/libcrypto/arch/sparc64/Makefile.inc
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile.inc,v 1.20 2024/10/19 11:55:32 jsing Exp $ 1# $OpenBSD: Makefile.inc,v 1.21 2025/02/14 12:01:58 jsing Exp $
2 2
3# sparc64-specific libcrypto build rules 3# sparc64-specific libcrypto build rules
4 4
@@ -11,11 +11,8 @@ CFLAGS+= -DGHASH_ASM
11SSLASM+= modes ghash-sparcv9 ghash-sparcv9 11SSLASM+= modes ghash-sparcv9 ghash-sparcv9
12# sha 12# sha
13SSLASM+= sha sha1-sparcv9 sha1-sparcv9 13SSLASM+= sha sha1-sparcv9 sha1-sparcv9
14CFLAGS+= -DSHA1_ASM
15SSLASM+= sha sha512-sparcv9 sha256-sparcv9 14SSLASM+= sha sha512-sparcv9 sha256-sparcv9
16CFLAGS+= -DSHA256_ASM
17SSLASM+= sha sha512-sparcv9 sha512-sparcv9 15SSLASM+= sha sha512-sparcv9 sha512-sparcv9
18CFLAGS+= -DSHA512_ASM
19 16
20.for dir src dst in ${SSLASM} 17.for dir src dst in ${SSLASM}
21SRCS+= ${dst}.S 18SRCS+= ${dst}.S
diff --git a/src/lib/libcrypto/arch/sparc64/crypto_arch.h b/src/lib/libcrypto/arch/sparc64/crypto_arch.h
index 7f1fc36cac..251957a5bc 100644
--- a/src/lib/libcrypto/arch/sparc64/crypto_arch.h
+++ b/src/lib/libcrypto/arch/sparc64/crypto_arch.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ 1/* $OpenBSD: crypto_arch.h,v 1.2 2025/02/14 12:01:58 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2024 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -23,6 +23,15 @@
23#define HAVE_AES_ENCRYPT_INTERNAL 23#define HAVE_AES_ENCRYPT_INTERNAL
24#define HAVE_AES_DECRYPT_INTERNAL 24#define HAVE_AES_DECRYPT_INTERNAL
25 25
26#define HAVE_SHA1_BLOCK_DATA_ORDER
27#define HAVE_SHA1_BLOCK_GENERIC
28
29#define HAVE_SHA256_BLOCK_DATA_ORDER
30#define HAVE_SHA256_BLOCK_GENERIC
31
32#define HAVE_SHA512_BLOCK_DATA_ORDER
33#define HAVE_SHA512_BLOCK_GENERIC
34
26#endif 35#endif
27 36
28#endif 37#endif