summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/arch/amd64
diff options
context:
space:
mode:
authorjsing <>2024-11-08 15:09:48 +0000
committerjsing <>2024-11-08 15:09:48 +0000
commit487da616d8ed3fd6ad6c30584c6405c6979ede11 (patch)
tree84d6d8d2658114716d976529462bcebc29b879ca /src/lib/libcrypto/arch/amd64
parentacc652186bbeb9458b641b1bffef14c7599bf465 (diff)
downloadopenbsd-487da616d8ed3fd6ad6c30584c6405c6979ede11.tar.gz
openbsd-487da616d8ed3fd6ad6c30584c6405c6979ede11.tar.bz2
openbsd-487da616d8ed3fd6ad6c30584c6405c6979ede11.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/amd64')
-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