Commit | Line | Data |
---|---|---|
b2441318 | 1 | # SPDX-License-Identifier: GPL-2.0 |
1da177e4 LT |
2 | # |
3 | # Cryptographic API | |
4 | # | |
5 | ||
c3715cb9 | 6 | obj-$(CONFIG_CRYPTO) += crypto.o |
abfed87e | 7 | crypto-y := api.o cipher.o compress.o |
1da177e4 | 8 | |
735d37b5 | 9 | obj-$(CONFIG_CRYPTO_ENGINE) += crypto_engine.o |
ccb778e1 NH |
10 | obj-$(CONFIG_CRYPTO_FIPS) += fips.o |
11 | ||
cce9e06d | 12 | crypto_algapi-$(CONFIG_PROC_FS) += proc.o |
21ea28ab | 13 | crypto_algapi-y := algapi.o scatterwalk.o $(crypto_algapi-y) |
6a0fcbb4 | 14 | obj-$(CONFIG_CRYPTO_ALGAPI2) += crypto_algapi.o |
1da177e4 | 15 | |
6a0fcbb4 | 16 | obj-$(CONFIG_CRYPTO_AEAD2) += aead.o |
20cc01ba | 17 | obj-$(CONFIG_CRYPTO_AEAD2) += geniv.o |
653ebd9c | 18 | |
d63007eb | 19 | obj-$(CONFIG_CRYPTO_SKCIPHER2) += skcipher.o |
0a270321 | 20 | obj-$(CONFIG_CRYPTO_SEQIV) += seqiv.o |
a10f554f | 21 | obj-$(CONFIG_CRYPTO_ECHAINIV) += echainiv.o |
5cde0af2 | 22 | |
21ea28ab TD |
23 | crypto_hash-y += ahash.o |
24 | crypto_hash-y += shash.o | |
6a0fcbb4 | 25 | obj-$(CONFIG_CRYPTO_HASH2) += crypto_hash.o |
055bcee3 | 26 | |
3c339ab8 | 27 | obj-$(CONFIG_CRYPTO_AKCIPHER2) += akcipher.o |
4e5f2c40 | 28 | obj-$(CONFIG_CRYPTO_KPP2) += kpp.o |
a1d2f095 | 29 | |
802c7f1c SB |
30 | dh_generic-y := dh.o |
31 | dh_generic-y += dh_helper.o | |
32 | obj-$(CONFIG_CRYPTO_DH) += dh_generic.o | |
33 | ||
4fa8bc94 MY |
34 | $(obj)/rsapubkey.asn1.o: $(obj)/rsapubkey.asn1.c $(obj)/rsapubkey.asn1.h |
35 | $(obj)/rsaprivkey.asn1.o: $(obj)/rsaprivkey.asn1.c $(obj)/rsaprivkey.asn1.h | |
36 | $(obj)/rsa_helper.o: $(obj)/rsapubkey.asn1.h $(obj)/rsaprivkey.asn1.h | |
cfc2bb32 | 37 | |
4fa8bc94 MY |
38 | rsa_generic-y := rsapubkey.asn1.o |
39 | rsa_generic-y += rsaprivkey.asn1.o | |
cfc2bb32 TS |
40 | rsa_generic-y += rsa.o |
41 | rsa_generic-y += rsa_helper.o | |
3d5b1ecd | 42 | rsa_generic-y += rsa-pkcs1pad.o |
cfc2bb32 TS |
43 | obj-$(CONFIG_CRYPTO_RSA) += rsa_generic.o |
44 | ||
ea7ecb66 TZ |
45 | $(obj)/sm2signature.asn1.o: $(obj)/sm2signature.asn1.c $(obj)/sm2signature.asn1.h |
46 | $(obj)/sm2.o: $(obj)/sm2signature.asn1.h | |
47 | ||
48 | sm2_generic-y += sm2signature.asn1.o | |
49 | sm2_generic-y += sm2.o | |
50 | ||
51 | obj-$(CONFIG_CRYPTO_SM2) += sm2_generic.o | |
52 | ||
4e660291 SB |
53 | $(obj)/ecdsasignature.asn1.o: $(obj)/ecdsasignature.asn1.c $(obj)/ecdsasignature.asn1.h |
54 | $(obj)/ecdsa.o: $(obj)/ecdsasignature.asn1.h | |
55 | ecdsa_generic-y += ecdsa.o | |
56 | ecdsa_generic-y += ecdsasignature.asn1.o | |
57 | obj-$(CONFIG_CRYPTO_ECDSA) += ecdsa_generic.o | |
58 | ||
6c0f4000 GC |
59 | crypto_acompress-y := acompress.o |
60 | crypto_acompress-y += scompress.o | |
61 | obj-$(CONFIG_CRYPTO_ACOMP2) += crypto_acompress.o | |
2ebda74f | 62 | |
21ea28ab | 63 | cryptomgr-y := algboss.o testmgr.o |
da7f033d | 64 | |
6a0fcbb4 | 65 | obj-$(CONFIG_CRYPTO_MANAGER2) += cryptomgr.o |
a38f7907 | 66 | obj-$(CONFIG_CRYPTO_USER) += crypto_user.o |
2ced2607 CL |
67 | crypto_user-y := crypto_user_base.o |
68 | crypto_user-$(CONFIG_CRYPTO_STATS) += crypto_user_stat.o | |
93b5e86a | 69 | obj-$(CONFIG_CRYPTO_CMAC) += cmac.o |
1da177e4 | 70 | obj-$(CONFIG_CRYPTO_HMAC) += hmac.o |
f1939f7c | 71 | obj-$(CONFIG_CRYPTO_VMAC) += vmac.o |
333b0d7e | 72 | obj-$(CONFIG_CRYPTO_XCBC) += xcbc.o |
a26bcb04 | 73 | obj-$(CONFIG_CRYPTO_NULL2) += crypto_null.o |
1da177e4 LT |
74 | obj-$(CONFIG_CRYPTO_MD4) += md4.o |
75 | obj-$(CONFIG_CRYPTO_MD5) += md5.o | |
c6580eb8 | 76 | obj-$(CONFIG_CRYPTO_RMD160) += rmd160.o |
ad5d2789 SS |
77 | obj-$(CONFIG_CRYPTO_SHA1) += sha1_generic.o |
78 | obj-$(CONFIG_CRYPTO_SHA256) += sha256_generic.o | |
78f8b3a2 | 79 | obj-$(CONFIG_CRYPTO_SHA512) += sha512_generic.o |
53964b9e | 80 | obj-$(CONFIG_CRYPTO_SHA3) += sha3_generic.o |
d2825fa9 JD |
81 | obj-$(CONFIG_CRYPTO_SM3) += sm3.o |
82 | obj-$(CONFIG_CRYPTO_SM3_GENERIC) += sm3_generic.o | |
fe18957e | 83 | obj-$(CONFIG_CRYPTO_STREEBOG) += streebog_generic.o |
1da177e4 | 84 | obj-$(CONFIG_CRYPTO_WP512) += wp512.o |
7d6e9105 | 85 | CFLAGS_wp512.o := $(call cc-option,-fno-schedule-insns) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149 |
91d68933 | 86 | obj-$(CONFIG_CRYPTO_BLAKE2B) += blake2b_generic.o |
7f9b0880 | 87 | obj-$(CONFIG_CRYPTO_BLAKE2S) += blake2s_generic.o |
c494e070 | 88 | obj-$(CONFIG_CRYPTO_GF128MUL) += gf128mul.o |
db131ef9 HX |
89 | obj-$(CONFIG_CRYPTO_ECB) += ecb.o |
90 | obj-$(CONFIG_CRYPTO_CBC) += cbc.o | |
a7d85e06 | 91 | obj-$(CONFIG_CRYPTO_CFB) += cfb.o |
91652be5 | 92 | obj-$(CONFIG_CRYPTO_PCBC) += pcbc.o |
76cb9521 | 93 | obj-$(CONFIG_CRYPTO_CTS) += cts.o |
64470f1b | 94 | obj-$(CONFIG_CRYPTO_LRW) += lrw.o |
f19f5111 | 95 | obj-$(CONFIG_CRYPTO_XTS) += xts.o |
23e353c8 | 96 | obj-$(CONFIG_CRYPTO_CTR) += ctr.o |
1c49678e | 97 | obj-$(CONFIG_CRYPTO_KEYWRAP) += keywrap.o |
059c2a4d | 98 | obj-$(CONFIG_CRYPTO_ADIANTUM) += adiantum.o |
26609a21 | 99 | obj-$(CONFIG_CRYPTO_NHPOLY1305) += nhpoly1305.o |
28db8e3e | 100 | obj-$(CONFIG_CRYPTO_GCM) += gcm.o |
4a49b499 | 101 | obj-$(CONFIG_CRYPTO_CCM) += ccm.o |
71ebc4d1 | 102 | obj-$(CONFIG_CRYPTO_CHACHA20POLY1305) += chacha20poly1305.o |
f606a88e | 103 | obj-$(CONFIG_CRYPTO_AEGIS128) += aegis128.o |
cf3d41ad | 104 | aegis128-y := aegis128-core.o |
a4397635 AB |
105 | |
106 | ifeq ($(ARCH),arm) | |
2eb2d198 | 107 | CFLAGS_aegis128-neon-inner.o += -ffreestanding -march=armv8-a -mfloat-abi=softfp |
a4397635 AB |
108 | CFLAGS_aegis128-neon-inner.o += -mfpu=crypto-neon-fp-armv8 |
109 | aegis128-$(CONFIG_CRYPTO_AEGIS128_SIMD) += aegis128-neon.o aegis128-neon-inner.o | |
110 | endif | |
111 | ifeq ($(ARCH),arm64) | |
19842963 AB |
112 | aegis128-cflags-y := -ffreestanding -mcpu=generic+crypto |
113 | aegis128-cflags-$(CONFIG_CC_IS_GCC) += -ffixed-q16 -ffixed-q17 -ffixed-q18 \ | |
114 | -ffixed-q19 -ffixed-q20 -ffixed-q21 \ | |
115 | -ffixed-q22 -ffixed-q23 -ffixed-q24 \ | |
116 | -ffixed-q25 -ffixed-q26 -ffixed-q27 \ | |
117 | -ffixed-q28 -ffixed-q29 -ffixed-q30 \ | |
118 | -ffixed-q31 | |
119 | CFLAGS_aegis128-neon-inner.o += $(aegis128-cflags-y) | |
a4397635 AB |
120 | CFLAGS_REMOVE_aegis128-neon-inner.o += -mgeneral-regs-only |
121 | aegis128-$(CONFIG_CRYPTO_AEGIS128_SIMD) += aegis128-neon.o aegis128-neon-inner.o | |
122 | endif | |
04e85bbf AD |
123 | # Enable <arm_neon.h> |
124 | CFLAGS_aegis128-neon-inner.o += -isystem $(shell $(CC) -print-file-name=include) | |
a4397635 | 125 | |
5068c7a8 | 126 | obj-$(CONFIG_CRYPTO_PCRYPT) += pcrypt.o |
124b53d0 | 127 | obj-$(CONFIG_CRYPTO_CRYPTD) += cryptd.o |
c5a511f1 | 128 | obj-$(CONFIG_CRYPTO_DES) += des_generic.o |
90831639 | 129 | obj-$(CONFIG_CRYPTO_FCRYPT) += fcrypt.o |
3f2a5d2d | 130 | obj-$(CONFIG_CRYPTO_BLOWFISH) += blowfish_generic.o |
52ba867c | 131 | obj-$(CONFIG_CRYPTO_BLOWFISH_COMMON) += blowfish_common.o |
5b04fc17 | 132 | obj-$(CONFIG_CRYPTO_TWOFISH) += twofish_generic.o |
2729bb42 | 133 | obj-$(CONFIG_CRYPTO_TWOFISH_COMMON) += twofish_common.o |
dd6eec24 | 134 | obj-$(CONFIG_CRYPTO_SERPENT) += serpent_generic.o |
7d6e9105 | 135 | CFLAGS_serpent_generic.o := $(call cc-option,-fsched-pressure) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149 |
f8246af0 | 136 | obj-$(CONFIG_CRYPTO_AES) += aes_generic.o |
6e36719f | 137 | CFLAGS_aes_generic.o := $(call cc-option,-fno-code-hoisting) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83356 |
d2825fa9 JD |
138 | obj-$(CONFIG_CRYPTO_SM4) += sm4.o |
139 | obj-$(CONFIG_CRYPTO_SM4_GENERIC) += sm4_generic.o | |
b5e0b032 | 140 | obj-$(CONFIG_CRYPTO_AES_TI) += aes_ti.o |
075e39df | 141 | obj-$(CONFIG_CRYPTO_CAMELLIA) += camellia_generic.o |
044ab525 | 142 | obj-$(CONFIG_CRYPTO_CAST_COMMON) += cast_common.o |
270b0c6b | 143 | obj-$(CONFIG_CRYPTO_CAST5) += cast5_generic.o |
2b49b906 | 144 | obj-$(CONFIG_CRYPTO_CAST6) += cast6_generic.o |
1da177e4 LT |
145 | obj-$(CONFIG_CRYPTO_ARC4) += arc4.o |
146 | obj-$(CONFIG_CRYPTO_TEA) += tea.o | |
147 | obj-$(CONFIG_CRYPTO_KHAZAD) += khazad.o | |
148 | obj-$(CONFIG_CRYPTO_ANUBIS) += anubis.o | |
e2ee95b8 | 149 | obj-$(CONFIG_CRYPTO_SEED) += seed.o |
1ca1b917 | 150 | obj-$(CONFIG_CRYPTO_CHACHA20) += chacha_generic.o |
f979e014 | 151 | obj-$(CONFIG_CRYPTO_POLY1305) += poly1305_generic.o |
1da177e4 LT |
152 | obj-$(CONFIG_CRYPTO_DEFLATE) += deflate.o |
153 | obj-$(CONFIG_CRYPTO_MICHAEL_MIC) += michael_mic.o | |
06e5a1f2 | 154 | obj-$(CONFIG_CRYPTO_CRC32C) += crc32c_generic.o |
a7c58ac0 | 155 | obj-$(CONFIG_CRYPTO_CRC32) += crc32_generic.o |
26052f9b | 156 | obj-$(CONFIG_CRYPTO_CRCT10DIF) += crct10dif_common.o crct10dif_generic.o |
f3813f4b | 157 | obj-$(CONFIG_CRYPTO_CRC64_ROCKSOFT) += crc64_rocksoft_generic.o |
a5079d08 | 158 | obj-$(CONFIG_CRYPTO_AUTHENC) += authenc.o authencesn.o |
45ec975e | 159 | obj-$(CONFIG_CRYPTO_LZO) += lzo.o lzo-rle.o |
0ea8530d CM |
160 | obj-$(CONFIG_CRYPTO_LZ4) += lz4.o |
161 | obj-$(CONFIG_CRYPTO_LZ4HC) += lz4hc.o | |
67882e76 | 162 | obj-$(CONFIG_CRYPTO_XXHASH) += xxhash_generic.o |
35a1fc18 | 163 | obj-$(CONFIG_CRYPTO_842) += 842.o |
6a0fcbb4 | 164 | obj-$(CONFIG_CRYPTO_RNG2) += rng.o |
17f0f4a4 | 165 | obj-$(CONFIG_CRYPTO_ANSI_CPRNG) += ansi_cprng.o |
f2c89a10 | 166 | obj-$(CONFIG_CRYPTO_DRBG) += drbg.o |
dfc9fa91 SM |
167 | obj-$(CONFIG_CRYPTO_JITTERENTROPY) += jitterentropy_rng.o |
168 | CFLAGS_jitterentropy.o = -O0 | |
dec0fb39 AB |
169 | KASAN_SANITIZE_jitterentropy.o = n |
170 | UBSAN_SANITIZE_jitterentropy.o = n | |
dfc9fa91 | 171 | jitterentropy_rng-y := jitterentropy.o jitterentropy-kcapi.o |
1da177e4 | 172 | obj-$(CONFIG_CRYPTO_TEST) += tcrypt.o |
2cdc6899 | 173 | obj-$(CONFIG_CRYPTO_GHASH) += ghash-generic.o |
03c8efc1 | 174 | obj-$(CONFIG_CRYPTO_USER_API) += af_alg.o |
fe869cdb | 175 | obj-$(CONFIG_CRYPTO_USER_API_HASH) += algif_hash.o |
8ff59090 | 176 | obj-$(CONFIG_CRYPTO_USER_API_SKCIPHER) += algif_skcipher.o |
2f375538 | 177 | obj-$(CONFIG_CRYPTO_USER_API_RNG) += algif_rng.o |
44cac4fc | 178 | obj-$(CONFIG_CRYPTO_USER_API_AEAD) += algif_aead.o |
d28fc3db | 179 | obj-$(CONFIG_CRYPTO_ZSTD) += zstd.o |
e497c518 | 180 | obj-$(CONFIG_CRYPTO_OFB) += ofb.o |
4a2289da | 181 | obj-$(CONFIG_CRYPTO_ECC) += ecc.o |
be1eb7f7 | 182 | obj-$(CONFIG_CRYPTO_ESSIV) += essiv.o |
ee772cb6 | 183 | obj-$(CONFIG_CRYPTO_CURVE25519) += curve25519-generic.o |
685784aa | 184 | |
6755fd26 TDA |
185 | ecdh_generic-y += ecdh.o |
186 | ecdh_generic-y += ecdh_helper.o | |
187 | obj-$(CONFIG_CRYPTO_ECDH) += ecdh_generic.o | |
188 | ||
0d7a7864 VC |
189 | $(obj)/ecrdsa_params.asn1.o: $(obj)/ecrdsa_params.asn1.c $(obj)/ecrdsa_params.asn1.h |
190 | $(obj)/ecrdsa_pub_key.asn1.o: $(obj)/ecrdsa_pub_key.asn1.c $(obj)/ecrdsa_pub_key.asn1.h | |
191 | $(obj)/ecrdsa.o: $(obj)/ecrdsa_params.asn1.h $(obj)/ecrdsa_pub_key.asn1.h | |
192 | ecrdsa_generic-y += ecrdsa.o | |
193 | ecrdsa_generic-y += ecrdsa_params.asn1.o | |
194 | ecrdsa_generic-y += ecrdsa_pub_key.asn1.o | |
195 | obj-$(CONFIG_CRYPTO_ECRDSA) += ecrdsa_generic.o | |
196 | ||
685784aa DW |
197 | # |
198 | # generic algorithms and the async_tx api | |
199 | # | |
200 | obj-$(CONFIG_XOR_BLOCKS) += xor.o | |
9bc89cd8 | 201 | obj-$(CONFIG_ASYNC_CORE) += async_tx/ |
964f3b3b | 202 | obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/ |
ee08997f | 203 | obj-$(CONFIG_CRYPTO_HASH_INFO) += hash_info.o |
266d0516 HX |
204 | crypto_simd-y := simd.o |
205 | obj-$(CONFIG_CRYPTO_SIMD) += crypto_simd.o | |
026a733e SM |
206 | |
207 | # | |
208 | # Key derivation function | |
209 | # | |
210 | obj-$(CONFIG_CRYPTO_KDF800108_CTR) += kdf_sp800108.o |