summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/arch
diff options
context:
space:
mode:
authorjsing <>2024-11-08 15:09:48 +0000
committerjsing <>2024-11-08 15:09:48 +0000
commit04e057f72ee941e676968c3b04b6dd1f0f220d9a (patch)
tree84d6d8d2658114716d976529462bcebc29b879ca /src/lib/libcrypto/arch
parent7bfb9335fb0ae857523adc3e3686eeb719aafd2e (diff)
downloadopenbsd-04e057f72ee941e676968c3b04b6dd1f0f220d9a.tar.gz
openbsd-04e057f72ee941e676968c3b04b6dd1f0f220d9a.tar.bz2
openbsd-04e057f72ee941e676968c3b04b6dd1f0f220d9a.zip
Provide a replacement assembly implementation for SHA-256 on amd64.
Replace the perlasm generated SHA-256 assembly implementation with one that is actually readable. Call the assembly implementation from a C wrapper that can, in the future, dispatch to alternate implementations. Performance is similar (or even better) on modern CPUs, while somewhat slower on older CPUs (this is in part due to the wrapper, the impact of which is more noticable with small block sizes). Thanks to gkoehler@ and tb@ for testing. ok tb@
Diffstat (limited to 'src/lib/libcrypto/arch')
-rw-r--r--src/lib/libcrypto/arch/amd64/Makefile.inc9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/libcrypto/arch/amd64/Makefile.inc b/src/lib/libcrypto/arch/amd64/Makefile.inc
index 2f41f44381..07fcf46ed5 100644
--- a/src/lib/libcrypto/arch/amd64/Makefile.inc
+++ b/src/lib/libcrypto/arch/amd64/Makefile.inc
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile.inc,v 1.30 2024/10/18 13:36:24 jsing Exp $ 1# $OpenBSD: Makefile.inc,v 1.31 2024/11/08 15:09:48 jsing Exp $
2 2
3# amd64-specific libcrypto build rules 3# amd64-specific libcrypto build rules
4 4
@@ -51,11 +51,8 @@ SSLASM+= rc4 rc4-x86_64
51CFLAGS+= -DSHA1_ASM 51CFLAGS+= -DSHA1_ASM
52SSLASM+= sha sha1-x86_64 52SSLASM+= sha sha1-x86_64
53CFLAGS+= -DSHA256_ASM 53CFLAGS+= -DSHA256_ASM
54SRCS+= sha256-x86_64.S 54SRCS+= sha256_amd64.c
55GENERATED+= sha256-x86_64.S 55SRCS+= sha256_amd64_generic.S
56sha256-x86_64.S: ${LCRYPTO_SRC}/sha/asm/sha512-x86_64.pl ${EXTRA_PL}
57 cd ${LCRYPTO_SRC}/sha/asm ; \
58 /usr/bin/perl ./sha512-x86_64.pl ${.OBJDIR}/${.TARGET}
59CFLAGS+= -DSHA512_ASM 56CFLAGS+= -DSHA512_ASM
60SRCS+= sha512-x86_64.S 57SRCS+= sha512-x86_64.S
61GENERATED+= sha512-x86_64.S 58GENERATED+= sha512-x86_64.S