diff options
author | jsing <> | 2024-12-04 13:13:33 +0000 |
---|---|---|
committer | jsing <> | 2024-12-04 13:13:33 +0000 |
commit | 1c3ce6cc8e538cecc33ed58f89d969af28952dea (patch) | |
tree | 6adf1634c082704fca00fea488f843d1345662b2 /src/lib/libcrypto/arch | |
parent | 54b7e03a99e6dbd79315380653c1bf578c8444b0 (diff) | |
download | openbsd-1c3ce6cc8e538cecc33ed58f89d969af28952dea.tar.gz openbsd-1c3ce6cc8e538cecc33ed58f89d969af28952dea.tar.bz2 openbsd-1c3ce6cc8e538cecc33ed58f89d969af28952dea.zip |
Provide a replacement assembly implementation for SHA-1 on amd64.
As already done for SHA-256 and SHA-512, replace the perlasm generated
SHA-1 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. On a modern CPU the performance is around
5% faster than the base implementation generated by sha1-x86_64.pl, however
it is around 15% slower than the excessively complex SSSE2/AVX version that
is also generated by the same script (a SHA-NI version will greatly
outperform this and is much cleaner/simpler).
ok tb@
Diffstat (limited to 'src/lib/libcrypto/arch')
-rw-r--r-- | src/lib/libcrypto/arch/amd64/Makefile.inc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libcrypto/arch/amd64/Makefile.inc b/src/lib/libcrypto/arch/amd64/Makefile.inc index fe22385633..33c7dbba26 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.33 2024/11/16 15:31:36 jsing Exp $ | 1 | # $OpenBSD: Makefile.inc,v 1.34 2024/12/04 13:13:33 jsing Exp $ |
2 | 2 | ||
3 | # amd64-specific libcrypto build rules | 3 | # amd64-specific libcrypto build rules |
4 | 4 | ||
@@ -49,7 +49,8 @@ SSLASM+= rc4 rc4-x86_64 | |||
49 | # ripemd | 49 | # ripemd |
50 | # sha | 50 | # sha |
51 | CFLAGS+= -DSHA1_ASM | 51 | CFLAGS+= -DSHA1_ASM |
52 | SSLASM+= sha sha1-x86_64 | 52 | SRCS+= sha1_amd64.c |
53 | SRCS+= sha1_amd64_generic.S | ||
53 | CFLAGS+= -DSHA256_ASM | 54 | CFLAGS+= -DSHA256_ASM |
54 | SRCS+= sha256_amd64.c | 55 | SRCS+= sha256_amd64.c |
55 | SRCS+= sha256_amd64_generic.S | 56 | SRCS+= sha256_amd64_generic.S |