xref: /linux/lib/crypto/Makefile (revision 2b1ef7aeeb184ee78523f3d24e221296574c6f2d)
1dc51f257SArd Biesheuvel# SPDX-License-Identifier: GPL-2.0
2dc51f257SArd Biesheuvel
324c91b62SEric Biggersaflags-thumb2-$(CONFIG_THUMB2_KERNEL)  := -U__thumb2__ -D__thumb2__=1
424c91b62SEric Biggers
524c91b62SEric Biggersquiet_cmd_perlasm = PERLASM $@
624c91b62SEric Biggers      cmd_perlasm = $(PERL) $(<) > $(@)
724c91b62SEric Biggers
860e3f1e9SEric Biggersquiet_cmd_perlasm_with_args = PERLASM $@
960e3f1e9SEric Biggers      cmd_perlasm_with_args = $(PERL) $(<) void $(@)
1060e3f1e9SEric Biggers
114dcf6cadSEric Biggersobj-$(CONFIG_KUNIT)				+= tests/
124dcf6cadSEric Biggers
13aacb37f5SEric Biggersobj-$(CONFIG_CRYPTO_HASH_INFO)			+= hash_info.o
14aacb37f5SEric Biggers
157033b937SEric Biggersobj-$(CONFIG_CRYPTO_LIB_UTILS)			+= libcryptoutils.o
166e78ad0bSEric Biggerslibcryptoutils-y				:= memneq.o utils.o
177033b937SEric Biggers
18a22fd0e3SEric Biggers################################################################################
19a22fd0e3SEric Biggers
20e59c1c98SArd Biesheuvelobj-$(CONFIG_CRYPTO_LIB_AES) += libaes.o
21e59c1c98SArd Biesheuvellibaes-y := aes.o
22a22fd0e3SEric Biggersifeq ($(CONFIG_CRYPTO_LIB_AES_ARCH),y)
23a22fd0e3SEric BiggersCFLAGS_aes.o += -I$(src)/$(SRCARCH)
24fa229775SEric Biggers
25fa229775SEric Biggerslibaes-$(CONFIG_ARM) += arm/aes-cipher-core.o
26fa229775SEric Biggers
27*2b1ef7aeSEric Biggersifeq ($(CONFIG_ARM64),y)
28*2b1ef7aeSEric Biggerslibaes-y += arm64/aes-cipher-core.o
29*2b1ef7aeSEric Biggerslibaes-$(CONFIG_KERNEL_MODE_NEON) += arm64/aes-ce-core.o
30*2b1ef7aeSEric Biggersendif
31*2b1ef7aeSEric Biggers
32a22fd0e3SEric Biggersendif # CONFIG_CRYPTO_LIB_AES_ARCH
33a22fd0e3SEric Biggers
34a22fd0e3SEric Biggers################################################################################
35e59c1c98SArd Biesheuvel
36f1354404SArd Biesheuvelobj-$(CONFIG_CRYPTO_LIB_AESCFB)			+= libaescfb.o
37f1354404SArd Biesheuvellibaescfb-y					:= aescfb.o
38f1354404SArd Biesheuvel
39520af5daSArd Biesheuvelobj-$(CONFIG_CRYPTO_LIB_AESGCM)			+= libaesgcm.o
40520af5daSArd Biesheuvellibaesgcm-y					:= aesgcm.o
41520af5daSArd Biesheuvel
42dc51f257SArd Biesheuvelobj-$(CONFIG_CRYPTO_LIB_ARC4)			+= libarc4.o
43dc51f257SArd Biesheuvellibarc4-y					:= arc4.o
4404007b0eSArd Biesheuvel
4561c581a4SArd Biesheuvelobj-$(CONFIG_CRYPTO_LIB_GF128MUL)		+= gf128mul.o
4661c581a4SArd Biesheuvel
4739ee3970SEric Biggers################################################################################
4839ee3970SEric Biggers
4923a16c95SEric Biggersobj-$(CONFIG_CRYPTO_LIB_BLAKE2B) += libblake2b.o
5023a16c95SEric Biggerslibblake2b-y := blake2b.o
5123a16c95SEric Biggersifeq ($(CONFIG_CRYPTO_LIB_BLAKE2B_ARCH),y)
5223a16c95SEric BiggersCFLAGS_blake2b.o += -I$(src)/$(SRCARCH)
53ba6617bdSEric Biggerslibblake2b-$(CONFIG_ARM) += arm/blake2b-neon-core.o
5423a16c95SEric Biggersendif # CONFIG_CRYPTO_LIB_BLAKE2B_ARCH
5523a16c95SEric Biggers
5623a16c95SEric Biggers################################################################################
5723a16c95SEric Biggers
586048fdccSJason A. Donenfeld# blake2s is used by the /dev/random driver which is always builtin
5939ee3970SEric Biggersobj-y += blake2s.o
6039ee3970SEric Biggersifeq ($(CONFIG_CRYPTO_LIB_BLAKE2S_ARCH),y)
6139ee3970SEric BiggersCFLAGS_blake2s.o += -I$(src)/$(SRCARCH)
6239ee3970SEric Biggersobj-$(CONFIG_ARM) += arm/blake2s-core.o
6339ee3970SEric Biggersobj-$(CONFIG_X86) += x86/blake2s-core.o
6439ee3970SEric Biggersendif
6566d7fb94SJason A. Donenfeld
6613cecc52SEric Biggers################################################################################
6713cecc52SEric Biggers
6813cecc52SEric Biggers# chacha20_block() is used by the /dev/random driver which is always builtin
6913cecc52SEric Biggersobj-y += chacha-block-generic.o
7013cecc52SEric Biggers
7113cecc52SEric Biggersobj-$(CONFIG_CRYPTO_LIB_CHACHA) += libchacha.o
7213cecc52SEric Biggerslibchacha-y := chacha.o
7313cecc52SEric Biggers
7413cecc52SEric Biggersifeq ($(CONFIG_CRYPTO_LIB_CHACHA_ARCH),y)
7513cecc52SEric BiggersCFLAGS_chacha.o += -I$(src)/$(SRCARCH)
7613cecc52SEric Biggers
7713cecc52SEric Biggersifeq ($(CONFIG_ARM),y)
7813cecc52SEric Biggerslibchacha-y += arm/chacha-scalar-core.o
7913cecc52SEric Biggerslibchacha-$(CONFIG_KERNEL_MODE_NEON) += arm/chacha-neon-core.o
8013cecc52SEric Biggersendif
8113cecc52SEric Biggers
8213cecc52SEric Biggerslibchacha-$(CONFIG_ARM64) += arm64/chacha-neon-core.o
8313cecc52SEric Biggers
8413cecc52SEric Biggersifeq ($(CONFIG_MIPS),y)
8513cecc52SEric Biggerslibchacha-y += mips/chacha-core.o
8613cecc52SEric BiggersAFLAGS_mips/chacha-core.o += -O2 # needed to fill branch delay slots
8713cecc52SEric Biggersendif
8813cecc52SEric Biggers
8913cecc52SEric Biggerslibchacha-$(CONFIG_PPC) += powerpc/chacha-p10le-8x.o
9013cecc52SEric Biggerslibchacha-$(CONFIG_RISCV) += riscv/chacha-riscv64-zvkb.o
9113cecc52SEric Biggerslibchacha-$(CONFIG_S390) += s390/chacha-s390.o
9213cecc52SEric Biggerslibchacha-$(CONFIG_X86) += x86/chacha-ssse3-x86_64.o \
9313cecc52SEric Biggers			   x86/chacha-avx2-x86_64.o \
9413cecc52SEric Biggers			   x86/chacha-avx512vl-x86_64.o
9513cecc52SEric Biggersendif # CONFIG_CRYPTO_LIB_CHACHA_ARCH
9613cecc52SEric Biggers
9713cecc52SEric Biggers################################################################################
9813cecc52SEric Biggers
99ed20078bSArd Biesheuvelobj-$(CONFIG_CRYPTO_LIB_CHACHA20POLY1305)	+= libchacha20poly1305.o
100ed20078bSArd Biesheuvellibchacha20poly1305-y				+= chacha20poly1305.o
10140b99697SEric Biggerslibchacha20poly1305-$(CONFIG_CRYPTO_SELFTESTS)	+= chacha20poly1305-selftest.o
102ed20078bSArd Biesheuvel
10368546e56SEric Biggers################################################################################
10468546e56SEric Biggers
10568546e56SEric Biggersobj-$(CONFIG_CRYPTO_LIB_CURVE25519) += libcurve25519.o
10668546e56SEric Biggerslibcurve25519-y := curve25519.o
10768546e56SEric Biggers
10868546e56SEric Biggers# Disable GCOV in odd or sensitive code
10968546e56SEric BiggersGCOV_PROFILE_curve25519.o := n
11068546e56SEric Biggers
11168546e56SEric Biggersifeq ($(CONFIG_ARCH_SUPPORTS_INT128),y)
11268546e56SEric Biggerslibcurve25519-$(CONFIG_CRYPTO_LIB_CURVE25519_GENERIC) += curve25519-hacl64.o
11368546e56SEric Biggerselse
11468546e56SEric Biggerslibcurve25519-$(CONFIG_CRYPTO_LIB_CURVE25519_GENERIC) += curve25519-fiat32.o
11568546e56SEric Biggersendif
1162f13daeeSNathan Chancellor# clang versions prior to 18 may blow out the stack with KASAN
1172b81082aSNathan Chancellorifeq ($(CONFIG_CC_IS_CLANG)_$(call clang-min-version, 180000),y_)
1182f13daeeSNathan ChancellorKASAN_SANITIZE_curve25519-hacl64.o := n
1192f13daeeSNathan Chancellorendif
120a8bdf2c4SHerbert Xu
12168546e56SEric Biggersifeq ($(CONFIG_CRYPTO_LIB_CURVE25519_ARCH),y)
12268546e56SEric BiggersCFLAGS_curve25519.o += -I$(src)/$(SRCARCH)
12368546e56SEric Biggerslibcurve25519-$(CONFIG_ARM) += arm/curve25519-core.o
12468546e56SEric Biggerslibcurve25519-$(CONFIG_PPC) += powerpc/curve25519-ppc64le_asm.o
12568546e56SEric Biggersendif
12668546e56SEric Biggers
12768546e56SEric Biggers################################################################################
1280ed42a6fSJason A. Donenfeld
12904007b0eSArd Biesheuvelobj-$(CONFIG_CRYPTO_LIB_DES)			+= libdes.o
13004007b0eSArd Biesheuvellibdes-y					:= des.o
13101d3aee8SHans de Goede
132e1644613SEric Biggers################################################################################
133e1644613SEric Biggers
134e1644613SEric Biggersobj-$(CONFIG_CRYPTO_LIB_MD5) += libmd5.o
135e1644613SEric Biggerslibmd5-y := md5.o
136e1644613SEric Biggersifeq ($(CONFIG_CRYPTO_LIB_MD5_ARCH),y)
137e1644613SEric BiggersCFLAGS_md5.o += -I$(src)/$(SRCARCH)
13809371e13SEric Biggerslibmd5-$(CONFIG_PPC) += powerpc/md5-asm.o
139a1848f6eSEric Biggerslibmd5-$(CONFIG_SPARC) += sparc/md5_asm.o
140e1644613SEric Biggersendif # CONFIG_CRYPTO_LIB_MD5_ARCH
141e1644613SEric Biggers
142e1644613SEric Biggers################################################################################
143e1644613SEric Biggers
14464edcceaSEric Biggersobj-$(CONFIG_CRYPTO_LIB_MLDSA) += libmldsa.o
14564edcceaSEric Biggerslibmldsa-y := mldsa.o
14664edcceaSEric Biggers
14764edcceaSEric Biggers################################################################################
14864edcceaSEric Biggers
14914e15c71SEric Biggersobj-$(CONFIG_CRYPTO_LIB_NH) += libnh.o
15014e15c71SEric Biggerslibnh-y := nh.o
15114e15c71SEric Biggersifeq ($(CONFIG_CRYPTO_LIB_NH_ARCH),y)
15214e15c71SEric BiggersCFLAGS_nh.o += -I$(src)/$(SRCARCH)
15329e39a11SEric Biggerslibnh-$(CONFIG_ARM) += arm/nh-neon-core.o
154b4a8528dSEric Biggerslibnh-$(CONFIG_ARM64) += arm64/nh-neon-core.o
155a229d832SEric Biggerslibnh-$(CONFIG_X86) += x86/nh-sse2.o x86/nh-avx2.o
15614e15c71SEric Biggersendif
15714e15c71SEric Biggers
15814e15c71SEric Biggers################################################################################
15914e15c71SEric Biggers
1609b9d4ef0SHerbert Xuobj-$(CONFIG_CRYPTO_LIB_POLY1305) += libpoly1305.o
161b646b782SEric Biggerslibpoly1305-y := poly1305.o
162b646b782SEric Biggersifeq ($(CONFIG_ARCH_SUPPORTS_INT128),y)
163b646b782SEric Biggerslibpoly1305-$(CONFIG_CRYPTO_LIB_POLY1305_GENERIC) += poly1305-donna64.o
164b646b782SEric Biggerselse
165b646b782SEric Biggerslibpoly1305-$(CONFIG_CRYPTO_LIB_POLY1305_GENERIC) += poly1305-donna32.o
166b646b782SEric Biggersendif
16748ea8c6eSArd Biesheuvel
168b646b782SEric Biggersifeq ($(CONFIG_CRYPTO_LIB_POLY1305_ARCH),y)
169b646b782SEric BiggersCFLAGS_poly1305.o += -I$(src)/$(SRCARCH)
170b646b782SEric Biggers
171b646b782SEric Biggersifeq ($(CONFIG_ARM),y)
172b646b782SEric Biggerslibpoly1305-y += arm/poly1305-core.o
173b646b782SEric Biggers$(obj)/arm/poly1305-core.S: $(src)/arm/poly1305-armv4.pl
174b646b782SEric Biggers	$(call cmd,perlasm)
175b646b782SEric Biggers# massage the perlasm code a bit so we only get the NEON routine if we need it
176b646b782SEric Biggerspoly1305-aflags-$(CONFIG_CPU_V7) := -U__LINUX_ARM_ARCH__ -D__LINUX_ARM_ARCH__=5
177b646b782SEric Biggerspoly1305-aflags-$(CONFIG_KERNEL_MODE_NEON) := -U__LINUX_ARM_ARCH__ -D__LINUX_ARM_ARCH__=7
178b646b782SEric BiggersAFLAGS_arm/poly1305-core.o += $(poly1305-aflags-y) $(aflags-thumb2-y)
179b646b782SEric Biggersendif
180b646b782SEric Biggers
181b646b782SEric Biggersifeq ($(CONFIG_ARM64),y)
182b646b782SEric Biggerslibpoly1305-y += arm64/poly1305-core.o
183b646b782SEric Biggers$(obj)/arm64/poly1305-core.S: $(src)/arm64/poly1305-armv8.pl
184b646b782SEric Biggers	$(call cmd,perlasm_with_args)
185b646b782SEric Biggersendif
186b646b782SEric Biggers
187b646b782SEric Biggersifeq ($(CONFIG_MIPS),y)
188b646b782SEric Biggerslibpoly1305-y += mips/poly1305-core.o
189b646b782SEric Biggerspoly1305-perlasm-flavour-$(CONFIG_32BIT) := o32
190b646b782SEric Biggerspoly1305-perlasm-flavour-$(CONFIG_64BIT) := 64
191b646b782SEric Biggersquiet_cmd_perlasm_poly1305 = PERLASM $@
192b646b782SEric Biggers      cmd_perlasm_poly1305 = $(PERL) $< $(poly1305-perlasm-flavour-y) $@
193b646b782SEric Biggers# Use if_changed instead of cmd, in case the flavour changed.
194b646b782SEric Biggers$(obj)/mips/poly1305-core.S: $(src)/mips/poly1305-mips.pl FORCE
195b646b782SEric Biggers	$(call if_changed,perlasm_poly1305)
196b646b782SEric Biggerstargets += mips/poly1305-core.S
197b646b782SEric Biggersendif
198b646b782SEric Biggers
199b646b782SEric Biggerslibpoly1305-$(CONFIG_PPC) += powerpc/poly1305-p10le_64.o
200b646b782SEric Biggers
201bef9c755SZhihang Shaoifeq ($(CONFIG_RISCV),y)
202bef9c755SZhihang Shaolibpoly1305-y += riscv/poly1305-core.o
203bef9c755SZhihang Shaopoly1305-perlasm-flavour-$(CONFIG_32BIT) := 32
204bef9c755SZhihang Shaopoly1305-perlasm-flavour-$(CONFIG_64BIT) := 64
205bef9c755SZhihang Shaoquiet_cmd_perlasm_poly1305 = PERLASM $@
206bef9c755SZhihang Shao      cmd_perlasm_poly1305 = $(PERL) $< $(poly1305-perlasm-flavour-y) $@
207bef9c755SZhihang Shao# Use if_changed instead of cmd, in case the flavour changed.
208bef9c755SZhihang Shao$(obj)/riscv/poly1305-core.S: $(src)/riscv/poly1305-riscv.pl FORCE
209bef9c755SZhihang Shao	$(call if_changed,perlasm_poly1305)
210bef9c755SZhihang Shaotargets += riscv/poly1305-core.S
211bef9c755SZhihang ShaoAFLAGS_riscv/poly1305-core.o += -Dpoly1305_init=poly1305_block_init
212bef9c755SZhihang Shaoendif
213bef9c755SZhihang Shao
214b646b782SEric Biggersifeq ($(CONFIG_X86),y)
215b646b782SEric Biggerslibpoly1305-y += x86/poly1305-x86_64-cryptogams.o
216b646b782SEric Biggers$(obj)/x86/poly1305-x86_64-cryptogams.S: $(src)/x86/poly1305-x86_64-cryptogams.pl
217b646b782SEric Biggers	$(call cmd,perlasm)
218b646b782SEric Biggersendif
219b646b782SEric Biggers
220b646b782SEric Biggersendif # CONFIG_CRYPTO_LIB_POLY1305_ARCH
221b646b782SEric Biggers
222b646b782SEric Biggers# clean-files must be defined unconditionally
223b646b782SEric Biggersclean-files += arm/poly1305-core.S \
224b646b782SEric Biggers	       arm64/poly1305-core.S \
225b646b782SEric Biggers	       mips/poly1305-core.S \
226bef9c755SZhihang Shao	       riscv/poly1305-core.S \
227b646b782SEric Biggers	       x86/poly1305-x86_64-cryptogams.S
2289b9d4ef0SHerbert Xu
22990860aefSEric Biggers################################################################################
23090860aefSEric Biggers
2313d176751SEric Biggersobj-$(CONFIG_CRYPTO_LIB_POLYVAL) += libpolyval.o
2323d176751SEric Biggerslibpolyval-y := polyval.o
2333d176751SEric Biggersifeq ($(CONFIG_CRYPTO_LIB_POLYVAL_ARCH),y)
2343d176751SEric BiggersCFLAGS_polyval.o += -I$(src)/$(SRCARCH)
23537919e23SEric Biggerslibpolyval-$(CONFIG_ARM64) += arm64/polyval-ce-core.o
2364d8da355SEric Biggerslibpolyval-$(CONFIG_X86) += x86/polyval-pclmul-avx.o
2373d176751SEric Biggersendif
2383d176751SEric Biggers
2393d176751SEric Biggers################################################################################
2403d176751SEric Biggers
241ec8f7f48SEric Biggersobj-$(CONFIG_CRYPTO_LIB_SHA1) += libsha1.o
242ec8f7f48SEric Biggerslibsha1-y := sha1.o
24390860aefSEric Biggersifeq ($(CONFIG_CRYPTO_LIB_SHA1_ARCH),y)
24490860aefSEric BiggersCFLAGS_sha1.o += -I$(src)/$(SRCARCH)
24570cb6ca5SEric Biggersifeq ($(CONFIG_ARM),y)
24670cb6ca5SEric Biggerslibsha1-y += arm/sha1-armv4-large.o
24770cb6ca5SEric Biggerslibsha1-$(CONFIG_KERNEL_MODE_NEON) += arm/sha1-armv7-neon.o \
24870cb6ca5SEric Biggers				      arm/sha1-ce-core.o
24970cb6ca5SEric Biggersendif
25000d549bbSEric Biggerslibsha1-$(CONFIG_ARM64) += arm64/sha1-ce-core.o
2516b9ae8cfSEric Biggersifeq ($(CONFIG_PPC),y)
2526b9ae8cfSEric Biggerslibsha1-y += powerpc/sha1-powerpc-asm.o
2536b9ae8cfSEric Biggerslibsha1-$(CONFIG_SPE) += powerpc/sha1-spe-asm.o
2546b9ae8cfSEric Biggersendif
255c7510599SEric Biggerslibsha1-$(CONFIG_SPARC) += sparc/sha1_asm.o
256f3d6cb3dSEric Biggerslibsha1-$(CONFIG_X86) += x86/sha1-ssse3-and-avx.o \
257f3d6cb3dSEric Biggers			 x86/sha1-avx2-asm.o \
258f3d6cb3dSEric Biggers			 x86/sha1-ni-asm.o
25990860aefSEric Biggersendif # CONFIG_CRYPTO_LIB_SHA1_ARCH
260463f7408SEric Biggers
261e96cb950SEric Biggers################################################################################
262e96cb950SEric Biggers
26301d3aee8SHans de Goedeobj-$(CONFIG_CRYPTO_LIB_SHA256) += libsha256.o
26401d3aee8SHans de Goedelibsha256-y := sha256.o
265e96cb950SEric Biggersifeq ($(CONFIG_CRYPTO_LIB_SHA256_ARCH),y)
266e96cb950SEric BiggersCFLAGS_sha256.o += -I$(src)/$(SRCARCH)
26766d7fb94SJason A. Donenfeld
268e96cb950SEric Biggersifeq ($(CONFIG_ARM),y)
269e96cb950SEric Biggerslibsha256-y += arm/sha256-ce.o arm/sha256-core.o
270e96cb950SEric Biggers$(obj)/arm/sha256-core.S: $(src)/arm/sha256-armv4.pl
271e96cb950SEric Biggers	$(call cmd,perlasm)
272e96cb950SEric BiggersAFLAGS_arm/sha256-core.o += $(aflags-thumb2-y)
273e96cb950SEric Biggersendif
274e96cb950SEric Biggers
275e96cb950SEric Biggersifeq ($(CONFIG_ARM64),y)
276e96cb950SEric Biggerslibsha256-y += arm64/sha256-core.o
277e96cb950SEric Biggers$(obj)/arm64/sha256-core.S: $(src)/arm64/sha2-armv8.pl
278e96cb950SEric Biggers	$(call cmd,perlasm_with_args)
279e96cb950SEric Biggerslibsha256-$(CONFIG_KERNEL_MODE_NEON) += arm64/sha256-ce.o
280e96cb950SEric Biggersendif
281e96cb950SEric Biggers
282e96cb950SEric Biggerslibsha256-$(CONFIG_PPC) += powerpc/sha256-spe-asm.o
283e96cb950SEric Biggerslibsha256-$(CONFIG_RISCV) += riscv/sha256-riscv64-zvknha_or_zvknhb-zvkb.o
284e96cb950SEric Biggerslibsha256-$(CONFIG_SPARC) += sparc/sha256_asm.o
285e96cb950SEric Biggerslibsha256-$(CONFIG_X86) += x86/sha256-ssse3-asm.o \
286e96cb950SEric Biggers			   x86/sha256-avx-asm.o \
287e96cb950SEric Biggers			   x86/sha256-avx2-asm.o \
288e96cb950SEric Biggers			   x86/sha256-ni-asm.o
289e96cb950SEric Biggersendif # CONFIG_CRYPTO_LIB_SHA256_ARCH
290e96cb950SEric Biggers
291e96cb950SEric Biggers################################################################################
292950e5c84SEric Biggers
293b693c703SEric Biggersobj-$(CONFIG_CRYPTO_LIB_SHA512) += libsha512.o
294b693c703SEric Biggerslibsha512-y := sha512.o
295b693c703SEric Biggersifeq ($(CONFIG_CRYPTO_LIB_SHA512_ARCH),y)
296b693c703SEric BiggersCFLAGS_sha512.o += -I$(src)/$(SRCARCH)
29724c91b62SEric Biggers
29824c91b62SEric Biggersifeq ($(CONFIG_ARM),y)
29924c91b62SEric Biggerslibsha512-y += arm/sha512-core.o
30024c91b62SEric Biggers$(obj)/arm/sha512-core.S: $(src)/arm/sha512-armv4.pl
30124c91b62SEric Biggers	$(call cmd,perlasm)
30224c91b62SEric BiggersAFLAGS_arm/sha512-core.o += $(aflags-thumb2-y)
30324c91b62SEric Biggersendif
30424c91b62SEric Biggers
30560e3f1e9SEric Biggersifeq ($(CONFIG_ARM64),y)
30660e3f1e9SEric Biggerslibsha512-y += arm64/sha512-core.o
30761f86c70SEric Biggers$(obj)/arm64/sha512-core.S: $(src)/arm64/sha2-armv8.pl
30860e3f1e9SEric Biggers	$(call cmd,perlasm_with_args)
30960e3f1e9SEric Biggerslibsha512-$(CONFIG_KERNEL_MODE_NEON) += arm64/sha512-ce-core.o
31060e3f1e9SEric Biggersendif
311b59059a2SEric Biggers
312b59059a2SEric Biggerslibsha512-$(CONFIG_RISCV) += riscv/sha512-riscv64-zvknhb-zvkb.o
31302b35babSEric Biggerslibsha512-$(CONFIG_SPARC) += sparc/sha512_asm.o
314484c1811SEric Biggerslibsha512-$(CONFIG_X86) += x86/sha512-ssse3-asm.o \
315484c1811SEric Biggers			   x86/sha512-avx-asm.o \
316484c1811SEric Biggers			   x86/sha512-avx2-asm.o
317b693c703SEric Biggersendif # CONFIG_CRYPTO_LIB_SHA512_ARCH
318b693c703SEric Biggers
319e96cb950SEric Biggers################################################################################
320e96cb950SEric Biggers
32105934472SDavid Howellsobj-$(CONFIG_CRYPTO_LIB_SHA3) += libsha3.o
32205934472SDavid Howellslibsha3-y := sha3.o
32305934472SDavid Howells
3241e29a750SEric Biggersifeq ($(CONFIG_CRYPTO_LIB_SHA3_ARCH),y)
3251e29a750SEric BiggersCFLAGS_sha3.o += -I$(src)/$(SRCARCH)
3261e29a750SEric Biggerslibsha3-$(CONFIG_ARM64) += arm64/sha3-ce-core.o
3271e29a750SEric Biggersendif # CONFIG_CRYPTO_LIB_SHA3_ARCH
3281e29a750SEric Biggers
32905934472SDavid Howells################################################################################
33005934472SDavid Howells
3312a598d0bSHerbert Xuobj-$(CONFIG_MPILIB) += mpi/
3324964a1d9SEric Biggers
333ac90aad0SEric Biggersobj-$(CONFIG_CRYPTO_SELFTESTS_FULL)		+= simd.o
334f4065b2fSHerbert Xu
335f4065b2fSHerbert Xuobj-$(CONFIG_CRYPTO_LIB_SM3)			+= libsm3.o
336f4065b2fSHerbert Xulibsm3-y					:= sm3.o
3374a32e5dcSEric Biggers
338fd7e5de4STal Zussman# clean-files must be defined unconditionally
339fd7e5de4STal Zussmanclean-files += arm/sha256-core.S arm/sha512-core.S
340fd7e5de4STal Zussmanclean-files += arm64/sha256-core.S arm64/sha512-core.S
341