diff options
author | Shawn Landden <shawn@git.icu> | 2019-05-10 19:02:36 -0300 |
---|---|---|
committer | Shawn Landden <shawn@git.icu> | 2019-05-13 16:24:32 -0500 |
commit | 2b2e9c08b326409a28ef3d0237164e5ee67c7c6d (patch) | |
tree | d6ead58699723d4b42286696c18b42a14e832878 /src/crypto/Kbuild.include | |
parent | socket: set ignore_df=1 on xmit (diff) | |
download | wireguard-monolithic-historical-2b2e9c08b326409a28ef3d0237164e5ee67c7c6d.tar.xz wireguard-monolithic-historical-2b2e9c08b326409a28ef3d0237164e5ee67c7c6d.zip |
[Zinc] Add PowerPC chacha20 implementation from openssl/cryptograms
Only runs on the out-bound path, as the in-bound path is in an interrupt,
but that can be fixed in Linux.
Otherwise this is tested (with the VSX code enabled) on Power 9 (ppc64le).
Without this I get 2GiB/s over the loopback (so 4 GiB/s), and with this
I get 2.8 GiB/s (so 5.6 GiB/s), and more time is spent in poly1305 than chacha20.
This is on a 4-thread VPS.
Signed-off-by: Shawn Landden <shawn@git.icu>
v2: more complete simd.h for PPC
benchmarks
whitespace issues
v3: honor CONFIG_ALTIVEC (CONFIG_VSX has already honored)
Diffstat (limited to 'src/crypto/Kbuild.include')
-rw-r--r-- | src/crypto/Kbuild.include | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/crypto/Kbuild.include b/src/crypto/Kbuild.include index 460684d..4e05181 100644 --- a/src/crypto/Kbuild.include +++ b/src/crypto/Kbuild.include @@ -13,6 +13,12 @@ endif ifeq ($(CONFIG_MIPS)$(CONFIG_64BIT),yy) CONFIG_ZINC_ARCH_MIPS64 := y endif +ifeq ($(CONFIG_PPC32),y) +CONFIG_ZINC_ARCH_PPC32 := y +endif +ifeq ($(CONFIG_PPC64),y) +CONFIG_ZINC_ARCH_PPC64 := y +endif zinc-y += chacha20/chacha20.o zinc-$(CONFIG_ZINC_ARCH_X86_64) += chacha20/chacha20-x86_64.o @@ -20,6 +26,8 @@ zinc-$(CONFIG_ZINC_ARCH_ARM) += chacha20/chacha20-arm.o chacha20/chacha20-unroll zinc-$(CONFIG_ZINC_ARCH_ARM64) += chacha20/chacha20-arm64.o zinc-$(CONFIG_ZINC_ARCH_MIPS) += chacha20/chacha20-mips.o AFLAGS_chacha20-mips.o += -O2 # This is required to fill the branch delay slots +zinc-$(CONFIG_ZINC_ARCH_PPC32) += chacha20/chacha20-ppc.o +zinc-$(CONFIG_ZINC_ARCH_PPC64) += chacha20/chacha20-ppc.o zinc-y += poly1305/poly1305.o zinc-$(CONFIG_ZINC_ARCH_X86_64) += poly1305/poly1305-x86_64.o @@ -38,12 +46,18 @@ zinc-y += curve25519/curve25519.o zinc-$(CONFIG_ZINC_ARCH_ARM) += curve25519/curve25519-arm.o quiet_cmd_perlasm = PERLASM $@ - cmd_perlasm = $(PERL) $< > $@ + cmd_perlasm = $(PERL) $< $(perlflags-y) > $@ $(obj)/%.S: $(src)/%.pl FORCE $(call if_changed,perlasm) kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) targets := $(patsubst $(kbuild-dir)/%.pl,%.S,$(wildcard $(patsubst %.o,$(kbuild-dir)/crypto/zinc/%.pl,$(zinc-y) $(zinc-m) $(zinc-)))) +perlflags-$(CONFIG_ZINC_ARCH_PPC32) += linux32 +ifeq ($(CONFIG_ZINC_ARCH_PPC64),y) +perlflags-$(CONFIG_CPU_BIG_ENDIAN) += linux64 +perlflags-$(CONFIG_CPU_LITTLE_ENDIAN) += linux64le +endif + # Old kernels don't set this, which causes trouble. .SECONDARY: @@ -54,4 +68,6 @@ ccflags-$(CONFIG_ZINC_ARCH_ARM) += -DCONFIG_ZINC_ARCH_ARM ccflags-$(CONFIG_ZINC_ARCH_ARM64) += -DCONFIG_ZINC_ARCH_ARM64 ccflags-$(CONFIG_ZINC_ARCH_MIPS) += -DCONFIG_ZINC_ARCH_MIPS ccflags-$(CONFIG_ZINC_ARCH_MIPS64) += -DCONFIG_ZINC_ARCH_MIPS64 +ccflags-$(CONFIG_ZINC_ARCH_PPC32) += -DCONFIG_ZINC_ARCH_PPC32 +ccflags-$(CONFIG_ZINC_ARCH_PPC64) += -DCONFIG_ZINC_ARCH_PPC64 ccflags-$(CONFIG_WIREGUARD_DEBUG) += -DCONFIG_ZINC_SELFTEST |