1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0 21da177e4SLinus Torvalds# 31da177e4SLinus Torvalds# Cryptographic API 41da177e4SLinus Torvalds# 51da177e4SLinus Torvalds 6c3715cb9SSebastian Siewiorobj-$(CONFIG_CRYPTO) += crypto.o 7920b0442SJason A. Donenfeldcrypto-y := api.o cipher.o compress.o 81da177e4SLinus Torvalds 9735d37b5SBaolin Wangobj-$(CONFIG_CRYPTO_ENGINE) += crypto_engine.o 10ccb778e1SNeil Hormanobj-$(CONFIG_CRYPTO_FIPS) += fips.o 11ccb778e1SNeil Horman 12cce9e06dSHerbert Xucrypto_algapi-$(CONFIG_PROC_FS) += proc.o 1321ea28abSTracey Dentcrypto_algapi-y := algapi.o scatterwalk.o $(crypto_algapi-y) 146a0fcbb4SHerbert Xuobj-$(CONFIG_CRYPTO_ALGAPI2) += crypto_algapi.o 151da177e4SLinus Torvalds 166a0fcbb4SHerbert Xuobj-$(CONFIG_CRYPTO_AEAD2) += aead.o 17ba51738fSHerbert Xuobj-$(CONFIG_CRYPTO_GENIV) += geniv.o 18653ebd9cSHerbert Xu 19d63007ebSArd Biesheuvelobj-$(CONFIG_CRYPTO_SKCIPHER2) += skcipher.o 200a270321SHerbert Xuobj-$(CONFIG_CRYPTO_SEQIV) += seqiv.o 21a10f554fSHerbert Xuobj-$(CONFIG_CRYPTO_ECHAINIV) += echainiv.o 225cde0af2SHerbert Xu 2321ea28abSTracey Dentcrypto_hash-y += ahash.o 2421ea28abSTracey Dentcrypto_hash-y += shash.o 256a0fcbb4SHerbert Xuobj-$(CONFIG_CRYPTO_HASH2) += crypto_hash.o 26055bcee3SHerbert Xu 273c339ab8STadeusz Strukobj-$(CONFIG_CRYPTO_AKCIPHER2) += akcipher.o 28*6cb8815fSHerbert Xuobj-$(CONFIG_CRYPTO_SIG2) += sig.o 294e5f2c40SSalvatore Benedettoobj-$(CONFIG_CRYPTO_KPP2) += kpp.o 30a1d2f095SGeert Uytterhoeven 31802c7f1cSSalvatore Benedettodh_generic-y := dh.o 32802c7f1cSSalvatore Benedettodh_generic-y += dh_helper.o 33802c7f1cSSalvatore Benedettoobj-$(CONFIG_CRYPTO_DH) += dh_generic.o 34802c7f1cSSalvatore Benedetto 354fa8bc94SMasahiro Yamada$(obj)/rsapubkey.asn1.o: $(obj)/rsapubkey.asn1.c $(obj)/rsapubkey.asn1.h 364fa8bc94SMasahiro Yamada$(obj)/rsaprivkey.asn1.o: $(obj)/rsaprivkey.asn1.c $(obj)/rsaprivkey.asn1.h 374fa8bc94SMasahiro Yamada$(obj)/rsa_helper.o: $(obj)/rsapubkey.asn1.h $(obj)/rsaprivkey.asn1.h 38cfc2bb32STadeusz Struk 394fa8bc94SMasahiro Yamadarsa_generic-y := rsapubkey.asn1.o 404fa8bc94SMasahiro Yamadarsa_generic-y += rsaprivkey.asn1.o 41cfc2bb32STadeusz Strukrsa_generic-y += rsa.o 42cfc2bb32STadeusz Strukrsa_generic-y += rsa_helper.o 433d5b1ecdSAndrzej Zaborowskirsa_generic-y += rsa-pkcs1pad.o 44cfc2bb32STadeusz Strukobj-$(CONFIG_CRYPTO_RSA) += rsa_generic.o 45cfc2bb32STadeusz Struk 46ea7ecb66STianjia Zhang$(obj)/sm2signature.asn1.o: $(obj)/sm2signature.asn1.c $(obj)/sm2signature.asn1.h 47ea7ecb66STianjia Zhang$(obj)/sm2.o: $(obj)/sm2signature.asn1.h 48ea7ecb66STianjia Zhang 49ea7ecb66STianjia Zhangsm2_generic-y += sm2signature.asn1.o 50ea7ecb66STianjia Zhangsm2_generic-y += sm2.o 51ea7ecb66STianjia Zhang 52ea7ecb66STianjia Zhangobj-$(CONFIG_CRYPTO_SM2) += sm2_generic.o 53ea7ecb66STianjia Zhang 544e660291SStefan Berger$(obj)/ecdsasignature.asn1.o: $(obj)/ecdsasignature.asn1.c $(obj)/ecdsasignature.asn1.h 554e660291SStefan Berger$(obj)/ecdsa.o: $(obj)/ecdsasignature.asn1.h 564e660291SStefan Bergerecdsa_generic-y += ecdsa.o 574e660291SStefan Bergerecdsa_generic-y += ecdsasignature.asn1.o 584e660291SStefan Bergerobj-$(CONFIG_CRYPTO_ECDSA) += ecdsa_generic.o 594e660291SStefan Berger 606c0f4000SGiovanni Cabidducrypto_acompress-y := acompress.o 616c0f4000SGiovanni Cabidducrypto_acompress-y += scompress.o 626c0f4000SGiovanni Cabidduobj-$(CONFIG_CRYPTO_ACOMP2) += crypto_acompress.o 632ebda74fSGiovanni Cabiddu 6421ea28abSTracey Dentcryptomgr-y := algboss.o testmgr.o 65da7f033dSHerbert Xu 666a0fcbb4SHerbert Xuobj-$(CONFIG_CRYPTO_MANAGER2) += cryptomgr.o 67a38f7907SSteffen Klassertobj-$(CONFIG_CRYPTO_USER) += crypto_user.o 682ced2607SCorentin Labbecrypto_user-y := crypto_user_base.o 692ced2607SCorentin Labbecrypto_user-$(CONFIG_CRYPTO_STATS) += crypto_user_stat.o 7093b5e86aSJussi Kivilinnaobj-$(CONFIG_CRYPTO_CMAC) += cmac.o 711da177e4SLinus Torvaldsobj-$(CONFIG_CRYPTO_HMAC) += hmac.o 72f1939f7cSShane Wangobj-$(CONFIG_CRYPTO_VMAC) += vmac.o 73333b0d7eSKazunori MIYAZAWAobj-$(CONFIG_CRYPTO_XCBC) += xcbc.o 74a26bcb04SHerbert Xuobj-$(CONFIG_CRYPTO_NULL2) += crypto_null.o 751da177e4SLinus Torvaldsobj-$(CONFIG_CRYPTO_MD4) += md4.o 761da177e4SLinus Torvaldsobj-$(CONFIG_CRYPTO_MD5) += md5.o 77c6580eb8SAdrian-Ken Rueegseggerobj-$(CONFIG_CRYPTO_RMD160) += rmd160.o 78ad5d2789SSebastian Siewiorobj-$(CONFIG_CRYPTO_SHA1) += sha1_generic.o 79ad5d2789SSebastian Siewiorobj-$(CONFIG_CRYPTO_SHA256) += sha256_generic.o 8078f8b3a2SJan Glauberobj-$(CONFIG_CRYPTO_SHA512) += sha512_generic.o 8153964b9eSJeff Garzikobj-$(CONFIG_CRYPTO_SHA3) += sha3_generic.o 82d2825fa9SJason A. Donenfeldobj-$(CONFIG_CRYPTO_SM3) += sm3.o 83d2825fa9SJason A. Donenfeldobj-$(CONFIG_CRYPTO_SM3_GENERIC) += sm3_generic.o 84fe18957eSVitaly Chikunovobj-$(CONFIG_CRYPTO_STREEBOG) += streebog_generic.o 851da177e4SLinus Torvaldsobj-$(CONFIG_CRYPTO_WP512) += wp512.o 867d6e9105SArnd BergmannCFLAGS_wp512.o := $(call cc-option,-fno-schedule-insns) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149 8791d68933SDavid Sterbaobj-$(CONFIG_CRYPTO_BLAKE2B) += blake2b_generic.o 881d3551ceSLinus TorvaldsCFLAGS_blake2b_generic.o := -Wframe-larger-than=4096 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105930 89db131ef9SHerbert Xuobj-$(CONFIG_CRYPTO_ECB) += ecb.o 90db131ef9SHerbert Xuobj-$(CONFIG_CRYPTO_CBC) += cbc.o 91a7d85e06SJames Bottomleyobj-$(CONFIG_CRYPTO_CFB) += cfb.o 9291652be5SDavid Howellsobj-$(CONFIG_CRYPTO_PCBC) += pcbc.o 9376cb9521SKevin Coffmanobj-$(CONFIG_CRYPTO_CTS) += cts.o 9464470f1bSRik Snelobj-$(CONFIG_CRYPTO_LRW) += lrw.o 95f19f5111SRik Snelobj-$(CONFIG_CRYPTO_XTS) += xts.o 9623e353c8SJoy Lattenobj-$(CONFIG_CRYPTO_CTR) += ctr.o 9717fee07aSNathan Huckleberryobj-$(CONFIG_CRYPTO_XCTR) += xctr.o 987ff554ceSNathan Huckleberryobj-$(CONFIG_CRYPTO_HCTR2) += hctr2.o 991c49678eSStephan Muellerobj-$(CONFIG_CRYPTO_KEYWRAP) += keywrap.o 100059c2a4dSEric Biggersobj-$(CONFIG_CRYPTO_ADIANTUM) += adiantum.o 10126609a21SEric Biggersobj-$(CONFIG_CRYPTO_NHPOLY1305) += nhpoly1305.o 10228db8e3eSMikko Herranenobj-$(CONFIG_CRYPTO_GCM) += gcm.o 1034a49b499SJoy Lattenobj-$(CONFIG_CRYPTO_CCM) += ccm.o 10471ebc4d1SMartin Williobj-$(CONFIG_CRYPTO_CHACHA20POLY1305) += chacha20poly1305.o 105f606a88eSOndrej Mosnacekobj-$(CONFIG_CRYPTO_AEGIS128) += aegis128.o 106cf3d41adSArd Biesheuvelaegis128-y := aegis128-core.o 107a4397635SArd Biesheuvel 108a4397635SArd Biesheuvelifeq ($(ARCH),arm) 1092eb2d198SArd BiesheuvelCFLAGS_aegis128-neon-inner.o += -ffreestanding -march=armv8-a -mfloat-abi=softfp 110a4397635SArd BiesheuvelCFLAGS_aegis128-neon-inner.o += -mfpu=crypto-neon-fp-armv8 111a4397635SArd Biesheuvelaegis128-$(CONFIG_CRYPTO_AEGIS128_SIMD) += aegis128-neon.o aegis128-neon-inner.o 112a4397635SArd Biesheuvelendif 113a4397635SArd Biesheuvelifeq ($(ARCH),arm64) 11419842963SArd Biesheuvelaegis128-cflags-y := -ffreestanding -mcpu=generic+crypto 11519842963SArd Biesheuvelaegis128-cflags-$(CONFIG_CC_IS_GCC) += -ffixed-q16 -ffixed-q17 -ffixed-q18 \ 11619842963SArd Biesheuvel -ffixed-q19 -ffixed-q20 -ffixed-q21 \ 11719842963SArd Biesheuvel -ffixed-q22 -ffixed-q23 -ffixed-q24 \ 11819842963SArd Biesheuvel -ffixed-q25 -ffixed-q26 -ffixed-q27 \ 11919842963SArd Biesheuvel -ffixed-q28 -ffixed-q29 -ffixed-q30 \ 12019842963SArd Biesheuvel -ffixed-q31 12119842963SArd BiesheuvelCFLAGS_aegis128-neon-inner.o += $(aegis128-cflags-y) 122a4397635SArd BiesheuvelCFLAGS_REMOVE_aegis128-neon-inner.o += -mgeneral-regs-only 123a4397635SArd Biesheuvelaegis128-$(CONFIG_CRYPTO_AEGIS128_SIMD) += aegis128-neon.o aegis128-neon-inner.o 124a4397635SArd Biesheuvelendif 12504e85bbfSAlexey Dobriyan# Enable <arm_neon.h> 12604e85bbfSAlexey DobriyanCFLAGS_aegis128-neon-inner.o += -isystem $(shell $(CC) -print-file-name=include) 127a4397635SArd Biesheuvel 1285068c7a8SSteffen Klassertobj-$(CONFIG_CRYPTO_PCRYPT) += pcrypt.o 129124b53d0SHerbert Xuobj-$(CONFIG_CRYPTO_CRYPTD) += cryptd.o 130c5a511f1SSebastian Siewiorobj-$(CONFIG_CRYPTO_DES) += des_generic.o 13190831639SDavid Howellsobj-$(CONFIG_CRYPTO_FCRYPT) += fcrypt.o 1323f2a5d2dSJussi Kivilinnaobj-$(CONFIG_CRYPTO_BLOWFISH) += blowfish_generic.o 13352ba867cSJussi Kivilinnaobj-$(CONFIG_CRYPTO_BLOWFISH_COMMON) += blowfish_common.o 1345b04fc17SJoachim Fritschiobj-$(CONFIG_CRYPTO_TWOFISH) += twofish_generic.o 1352729bb42SJoachim Fritschiobj-$(CONFIG_CRYPTO_TWOFISH_COMMON) += twofish_common.o 136dd6eec24SJussi Kivilinnaobj-$(CONFIG_CRYPTO_SERPENT) += serpent_generic.o 1377d6e9105SArnd BergmannCFLAGS_serpent_generic.o := $(call cc-option,-fsched-pressure) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149 138f8246af0SSebastian Siewiorobj-$(CONFIG_CRYPTO_AES) += aes_generic.o 1396e36719fSArnd BergmannCFLAGS_aes_generic.o := $(call cc-option,-fno-code-hoisting) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83356 140d2825fa9SJason A. Donenfeldobj-$(CONFIG_CRYPTO_SM4) += sm4.o 141d2825fa9SJason A. Donenfeldobj-$(CONFIG_CRYPTO_SM4_GENERIC) += sm4_generic.o 142b5e0b032SArd Biesheuvelobj-$(CONFIG_CRYPTO_AES_TI) += aes_ti.o 143075e39dfSJussi Kivilinnaobj-$(CONFIG_CRYPTO_CAMELLIA) += camellia_generic.o 144044ab525SJussi Kivilinnaobj-$(CONFIG_CRYPTO_CAST_COMMON) += cast_common.o 145270b0c6bSJohannes Goetzfriedobj-$(CONFIG_CRYPTO_CAST5) += cast5_generic.o 1462b49b906SJohannes Goetzfriedobj-$(CONFIG_CRYPTO_CAST6) += cast6_generic.o 1471da177e4SLinus Torvaldsobj-$(CONFIG_CRYPTO_ARC4) += arc4.o 1481da177e4SLinus Torvaldsobj-$(CONFIG_CRYPTO_TEA) += tea.o 1491da177e4SLinus Torvaldsobj-$(CONFIG_CRYPTO_KHAZAD) += khazad.o 1501da177e4SLinus Torvaldsobj-$(CONFIG_CRYPTO_ANUBIS) += anubis.o 151e2ee95b8SHye-Shik Changobj-$(CONFIG_CRYPTO_SEED) += seed.o 152a9b0838dSTaehee Yooobj-$(CONFIG_CRYPTO_ARIA) += aria_generic.o 1531ca1b917SEric Biggersobj-$(CONFIG_CRYPTO_CHACHA20) += chacha_generic.o 154f979e014SMartin Williobj-$(CONFIG_CRYPTO_POLY1305) += poly1305_generic.o 1551da177e4SLinus Torvaldsobj-$(CONFIG_CRYPTO_DEFLATE) += deflate.o 1561da177e4SLinus Torvaldsobj-$(CONFIG_CRYPTO_MICHAEL_MIC) += michael_mic.o 15706e5a1f2STim Chenobj-$(CONFIG_CRYPTO_CRC32C) += crc32c_generic.o 158a7c58ac0SHerbert Xuobj-$(CONFIG_CRYPTO_CRC32) += crc32_generic.o 15926052f9bSHerbert Xuobj-$(CONFIG_CRYPTO_CRCT10DIF) += crct10dif_common.o crct10dif_generic.o 160f3813f4bSKeith Buschobj-$(CONFIG_CRYPTO_CRC64_ROCKSOFT) += crc64_rocksoft_generic.o 161a5079d08SSteffen Klassertobj-$(CONFIG_CRYPTO_AUTHENC) += authenc.o authencesn.o 16245ec975eSDave Rodgmanobj-$(CONFIG_CRYPTO_LZO) += lzo.o lzo-rle.o 1630ea8530dSChanho Minobj-$(CONFIG_CRYPTO_LZ4) += lz4.o 1640ea8530dSChanho Minobj-$(CONFIG_CRYPTO_LZ4HC) += lz4hc.o 16567882e76SNikolay Borisovobj-$(CONFIG_CRYPTO_XXHASH) += xxhash_generic.o 16635a1fc18SSeth Jenningsobj-$(CONFIG_CRYPTO_842) += 842.o 1676a0fcbb4SHerbert Xuobj-$(CONFIG_CRYPTO_RNG2) += rng.o 16817f0f4a4SNeil Hormanobj-$(CONFIG_CRYPTO_ANSI_CPRNG) += ansi_cprng.o 169f2c89a10SHerbert Xuobj-$(CONFIG_CRYPTO_DRBG) += drbg.o 170dfc9fa91SStephan Muellerobj-$(CONFIG_CRYPTO_JITTERENTROPY) += jitterentropy_rng.o 171dfc9fa91SStephan MuellerCFLAGS_jitterentropy.o = -O0 172dec0fb39SArnd BergmannKASAN_SANITIZE_jitterentropy.o = n 173dec0fb39SArnd BergmannUBSAN_SANITIZE_jitterentropy.o = n 174dfc9fa91SStephan Muellerjitterentropy_rng-y := jitterentropy.o jitterentropy-kcapi.o 17569f1c387SStephan Müllerobj-$(CONFIG_CRYPTO_JITTERENTROPY_TESTINTERFACE) += jitterentropy-testing.o 1761da177e4SLinus Torvaldsobj-$(CONFIG_CRYPTO_TEST) += tcrypt.o 1772cdc6899SHuang Yingobj-$(CONFIG_CRYPTO_GHASH) += ghash-generic.o 178f3c923a0SNathan Huckleberryobj-$(CONFIG_CRYPTO_POLYVAL) += polyval-generic.o 17903c8efc1SHerbert Xuobj-$(CONFIG_CRYPTO_USER_API) += af_alg.o 180fe869cdbSHerbert Xuobj-$(CONFIG_CRYPTO_USER_API_HASH) += algif_hash.o 1818ff59090SHerbert Xuobj-$(CONFIG_CRYPTO_USER_API_SKCIPHER) += algif_skcipher.o 1822f375538SStephan Muellerobj-$(CONFIG_CRYPTO_USER_API_RNG) += algif_rng.o 18344cac4fcSStephan Muellerobj-$(CONFIG_CRYPTO_USER_API_AEAD) += algif_aead.o 184d28fc3dbSNick Terrellobj-$(CONFIG_CRYPTO_ZSTD) += zstd.o 185e497c518SGilad Ben-Yossefobj-$(CONFIG_CRYPTO_OFB) += ofb.o 1864a2289daSVitaly Chikunovobj-$(CONFIG_CRYPTO_ECC) += ecc.o 187be1eb7f7SArd Biesheuvelobj-$(CONFIG_CRYPTO_ESSIV) += essiv.o 188ee772cb6SArd Biesheuvelobj-$(CONFIG_CRYPTO_CURVE25519) += curve25519-generic.o 189685784aaSDan Williams 1906755fd26STudor-Dan Ambarusecdh_generic-y += ecdh.o 1916755fd26STudor-Dan Ambarusecdh_generic-y += ecdh_helper.o 1926755fd26STudor-Dan Ambarusobj-$(CONFIG_CRYPTO_ECDH) += ecdh_generic.o 1936755fd26STudor-Dan Ambarus 1940d7a7864SVitaly Chikunov$(obj)/ecrdsa_params.asn1.o: $(obj)/ecrdsa_params.asn1.c $(obj)/ecrdsa_params.asn1.h 1950d7a7864SVitaly Chikunov$(obj)/ecrdsa_pub_key.asn1.o: $(obj)/ecrdsa_pub_key.asn1.c $(obj)/ecrdsa_pub_key.asn1.h 1960d7a7864SVitaly Chikunov$(obj)/ecrdsa.o: $(obj)/ecrdsa_params.asn1.h $(obj)/ecrdsa_pub_key.asn1.h 1970d7a7864SVitaly Chikunovecrdsa_generic-y += ecrdsa.o 1980d7a7864SVitaly Chikunovecrdsa_generic-y += ecrdsa_params.asn1.o 1990d7a7864SVitaly Chikunovecrdsa_generic-y += ecrdsa_pub_key.asn1.o 2000d7a7864SVitaly Chikunovobj-$(CONFIG_CRYPTO_ECRDSA) += ecrdsa_generic.o 2010d7a7864SVitaly Chikunov 202685784aaSDan Williams# 203685784aaSDan Williams# generic algorithms and the async_tx api 204685784aaSDan Williams# 205685784aaSDan Williamsobj-$(CONFIG_XOR_BLOCKS) += xor.o 2069bc89cd8SDan Williamsobj-$(CONFIG_ASYNC_CORE) += async_tx/ 207964f3b3bSDavid Howellsobj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/ 208ee08997fSDmitry Kasatkinobj-$(CONFIG_CRYPTO_HASH_INFO) += hash_info.o 209266d0516SHerbert Xucrypto_simd-y := simd.o 210266d0516SHerbert Xuobj-$(CONFIG_CRYPTO_SIMD) += crypto_simd.o 211026a733eSStephan Müller 212026a733eSStephan Müller# 213026a733eSStephan Müller# Key derivation function 214026a733eSStephan Müller# 215026a733eSStephan Müllerobj-$(CONFIG_CRYPTO_KDF800108_CTR) += kdf_sp800108.o 216