Skip to content

Commit 6ecc9d9

Browse files
WOnder93herbertx
authored andcommitted
crypto: x86 - Add optimized MORUS implementations
This patch adds optimized implementations of MORUS-640 and MORUS-1280, utilizing the SSE2 and AVX2 x86 extensions. For MORUS-1280 (which operates on 256-bit blocks) we provide both AVX2 and SSE2 implementation. Although SSE2 MORUS-1280 is slower than AVX2 MORUS-1280, it is comparable in speed to the SSE2 MORUS-640. Signed-off-by: Ondrej Mosnacek <omosnacek@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 56e8e57 commit 6ecc9d9

File tree

8 files changed

+2370
-0
lines changed

8 files changed

+2370
-0
lines changed

arch/x86/crypto/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ obj-$(CONFIG_CRYPTO_AEGIS128_AESNI_SSE2) += aegis128-aesni.o
4242
obj-$(CONFIG_CRYPTO_AEGIS128L_AESNI_SSE2) += aegis128l-aesni.o
4343
obj-$(CONFIG_CRYPTO_AEGIS256_AESNI_SSE2) += aegis256-aesni.o
4444

45+
obj-$(CONFIG_CRYPTO_MORUS640_SSE2) += morus640-sse2.o
46+
obj-$(CONFIG_CRYPTO_MORUS1280_SSE2) += morus1280-sse2.o
47+
4548
# These modules require assembler to support AVX.
4649
ifeq ($(avx_supported),yes)
4750
obj-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64) += \
@@ -59,6 +62,8 @@ ifeq ($(avx2_supported),yes)
5962
obj-$(CONFIG_CRYPTO_SHA1_MB) += sha1-mb/
6063
obj-$(CONFIG_CRYPTO_SHA256_MB) += sha256-mb/
6164
obj-$(CONFIG_CRYPTO_SHA512_MB) += sha512-mb/
65+
66+
obj-$(CONFIG_CRYPTO_MORUS1280_AVX2) += morus1280-avx2.o
6267
endif
6368

6469
aes-i586-y := aes-i586-asm_32.o aes_glue.o
@@ -80,6 +85,9 @@ aegis128-aesni-y := aegis128-aesni-asm.o aegis128-aesni-glue.o
8085
aegis128l-aesni-y := aegis128l-aesni-asm.o aegis128l-aesni-glue.o
8186
aegis256-aesni-y := aegis256-aesni-asm.o aegis256-aesni-glue.o
8287

88+
morus640-sse2-y := morus640-sse2-asm.o morus640-sse2-glue.o
89+
morus1280-sse2-y := morus1280-sse2-asm.o morus1280-sse2-glue.o
90+
8391
ifeq ($(avx_supported),yes)
8492
camellia-aesni-avx-x86_64-y := camellia-aesni-avx-asm_64.o \
8593
camellia_aesni_avx_glue.o
@@ -95,6 +103,8 @@ ifeq ($(avx2_supported),yes)
95103
camellia-aesni-avx2-y := camellia-aesni-avx2-asm_64.o camellia_aesni_avx2_glue.o
96104
chacha20-x86_64-y += chacha20-avx2-x86_64.o
97105
serpent-avx2-y := serpent-avx2-asm_64.o serpent_avx2_glue.o
106+
107+
morus1280-avx2-y := morus1280-avx2-asm.o morus1280-avx2-glue.o
98108
endif
99109

100110
aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o fpu.o

0 commit comments

Comments
 (0)