diff options
author | jsing <> | 2025-02-14 12:01:58 +0000 |
---|---|---|
committer | jsing <> | 2025-02-14 12:01:58 +0000 |
commit | 55a1827d4b1706532809a68f02c30336000e01a9 (patch) | |
tree | 606af9a8caef4eada19e055b0a35e755d199b0d1 /src/lib/libcrypto/arch/i386 | |
parent | aee4d44b17e8fc57dfaadf57efabb128712c9f72 (diff) | |
download | openbsd-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/i386')
-rw-r--r-- | src/lib/libcrypto/arch/i386/Makefile.inc | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/arch/i386/crypto_arch.h | 11 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/lib/libcrypto/arch/i386/Makefile.inc b/src/lib/libcrypto/arch/i386/Makefile.inc index 2101304703..6989b35686 100644 --- a/src/lib/libcrypto/arch/i386/Makefile.inc +++ b/src/lib/libcrypto/arch/i386/Makefile.inc | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile.inc,v 1.26 2024/10/18 14:44:02 jsing Exp $ | 1 | # $OpenBSD: Makefile.inc,v 1.27 2025/02/14 12:01:58 jsing Exp $ |
2 | 2 | ||
3 | # i386-specific libcrypto build rules | 3 | # i386-specific libcrypto build rules |
4 | 4 | ||
@@ -28,11 +28,8 @@ SSLASM+= modes ghash-x86 | |||
28 | # rc4 | 28 | # rc4 |
29 | SSLASM+= rc4 rc4-586 | 29 | SSLASM+= rc4 rc4-586 |
30 | # sha | 30 | # sha |
31 | CFLAGS+= -DSHA1_ASM | ||
32 | SSLASM+= sha sha1-586 | 31 | SSLASM+= sha sha1-586 |
33 | CFLAGS+= -DSHA256_ASM | ||
34 | SSLASM+= sha sha256-586 | 32 | SSLASM+= sha sha256-586 |
35 | CFLAGS+= -DSHA512_ASM | ||
36 | SSLASM+= sha sha512-586 | 33 | SSLASM+= sha sha512-586 |
37 | 34 | ||
38 | .for dir f in ${SSLASM} | 35 | .for dir f in ${SSLASM} |
diff --git a/src/lib/libcrypto/arch/i386/crypto_arch.h b/src/lib/libcrypto/arch/i386/crypto_arch.h index 64b2da587b..3df3963d0b 100644 --- a/src/lib/libcrypto/arch/i386/crypto_arch.h +++ b/src/lib/libcrypto/arch/i386/crypto_arch.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: crypto_arch.h,v 1.3 2024/10/19 13:06:11 jsing Exp $ */ | 1 | /* $OpenBSD: crypto_arch.h,v 1.4 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 | * |
@@ -32,6 +32,15 @@ | |||
32 | #define HAVE_RC4_INTERNAL | 32 | #define HAVE_RC4_INTERNAL |
33 | #define HAVE_RC4_SET_KEY_INTERNAL | 33 | #define HAVE_RC4_SET_KEY_INTERNAL |
34 | 34 | ||
35 | #define HAVE_SHA1_BLOCK_DATA_ORDER | ||
36 | #define HAVE_SHA1_BLOCK_GENERIC | ||
37 | |||
38 | #define HAVE_SHA256_BLOCK_DATA_ORDER | ||
39 | #define HAVE_SHA256_BLOCK_GENERIC | ||
40 | |||
41 | #define HAVE_SHA512_BLOCK_DATA_ORDER | ||
42 | #define HAVE_SHA512_BLOCK_GENERIC | ||
43 | |||
35 | #endif | 44 | #endif |
36 | 45 | ||
37 | #endif | 46 | #endif |