diff options
author | jsing <> | 2024-11-08 15:09:48 +0000 |
---|---|---|
committer | jsing <> | 2024-11-08 15:09:48 +0000 |
commit | 04e057f72ee941e676968c3b04b6dd1f0f220d9a (patch) | |
tree | 84d6d8d2658114716d976529462bcebc29b879ca /src/lib/libcrypto/arch | |
parent | 7bfb9335fb0ae857523adc3e3686eeb719aafd2e (diff) | |
download | openbsd-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.inc | 9 |
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 | |||
51 | CFLAGS+= -DSHA1_ASM | 51 | CFLAGS+= -DSHA1_ASM |
52 | SSLASM+= sha sha1-x86_64 | 52 | SSLASM+= sha sha1-x86_64 |
53 | CFLAGS+= -DSHA256_ASM | 53 | CFLAGS+= -DSHA256_ASM |
54 | SRCS+= sha256-x86_64.S | 54 | SRCS+= sha256_amd64.c |
55 | GENERATED+= sha256-x86_64.S | 55 | SRCS+= sha256_amd64_generic.S |
56 | sha256-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} | ||
59 | CFLAGS+= -DSHA512_ASM | 56 | CFLAGS+= -DSHA512_ASM |
60 | SRCS+= sha512-x86_64.S | 57 | SRCS+= sha512-x86_64.S |
61 | GENERATED+= sha512-x86_64.S | 58 | GENERATED+= sha512-x86_64.S |