Makefile 7.4 KB
Newer Older
1
# SPDX-License-Identifier: GPL-2.0
L
Linus Torvalds 已提交
2 3 4 5
#
# Cryptographic API
#

6
obj-$(CONFIG_CRYPTO) += crypto.o
7
crypto-y := api.o cipher.o compress.o memneq.o
L
Linus Torvalds 已提交
8

9
obj-$(CONFIG_CRYPTO_ENGINE) += crypto_engine.o
N
Neil Horman 已提交
10 11
obj-$(CONFIG_CRYPTO_FIPS) += fips.o

12
crypto_algapi-$(CONFIG_PROC_FS) += proc.o
T
Tracey Dent 已提交
13
crypto_algapi-y := algapi.o scatterwalk.o $(crypto_algapi-y)
14
obj-$(CONFIG_CRYPTO_ALGAPI2) += crypto_algapi.o
L
Linus Torvalds 已提交
15

16
obj-$(CONFIG_CRYPTO_AEAD2) += aead.o
17
obj-$(CONFIG_CRYPTO_AEAD2) += geniv.o
18

19
obj-$(CONFIG_CRYPTO_SKCIPHER2) += skcipher.o
20
obj-$(CONFIG_CRYPTO_SEQIV) += seqiv.o
21
obj-$(CONFIG_CRYPTO_ECHAINIV) += echainiv.o
22

T
Tracey Dent 已提交
23 24
crypto_hash-y += ahash.o
crypto_hash-y += shash.o
25
obj-$(CONFIG_CRYPTO_HASH2) += crypto_hash.o
26

T
Tadeusz Struk 已提交
27
obj-$(CONFIG_CRYPTO_AKCIPHER2) += akcipher.o
28
obj-$(CONFIG_CRYPTO_KPP2) += kpp.o
29

30 31 32 33
dh_generic-y := dh.o
dh_generic-y += dh_helper.o
obj-$(CONFIG_CRYPTO_DH) += dh_generic.o

34 35 36
$(obj)/rsapubkey.asn1.o: $(obj)/rsapubkey.asn1.c $(obj)/rsapubkey.asn1.h
$(obj)/rsaprivkey.asn1.o: $(obj)/rsaprivkey.asn1.c $(obj)/rsaprivkey.asn1.h
$(obj)/rsa_helper.o: $(obj)/rsapubkey.asn1.h $(obj)/rsaprivkey.asn1.h
37

38 39
rsa_generic-y := rsapubkey.asn1.o
rsa_generic-y += rsaprivkey.asn1.o
40 41
rsa_generic-y += rsa.o
rsa_generic-y += rsa_helper.o
42
rsa_generic-y += rsa-pkcs1pad.o
43 44
obj-$(CONFIG_CRYPTO_RSA) += rsa_generic.o

45 46 47 48 49 50 51 52
$(obj)/sm2signature.asn1.o: $(obj)/sm2signature.asn1.c $(obj)/sm2signature.asn1.h
$(obj)/sm2.o: $(obj)/sm2signature.asn1.h

sm2_generic-y += sm2signature.asn1.o
sm2_generic-y += sm2.o

obj-$(CONFIG_CRYPTO_SM2) += sm2_generic.o

53 54 55
crypto_acompress-y := acompress.o
crypto_acompress-y += scompress.o
obj-$(CONFIG_CRYPTO_ACOMP2) += crypto_acompress.o
56

T
Tracey Dent 已提交
57
cryptomgr-y := algboss.o testmgr.o
58

59
obj-$(CONFIG_CRYPTO_MANAGER2) += cryptomgr.o
60
obj-$(CONFIG_CRYPTO_USER) += crypto_user.o
61 62
crypto_user-y := crypto_user_base.o
crypto_user-$(CONFIG_CRYPTO_STATS) += crypto_user_stat.o
63
obj-$(CONFIG_CRYPTO_CMAC) += cmac.o
L
Linus Torvalds 已提交
64
obj-$(CONFIG_CRYPTO_HMAC) += hmac.o
65
obj-$(CONFIG_CRYPTO_VMAC) += vmac.o
K
Kazunori MIYAZAWA 已提交
66
obj-$(CONFIG_CRYPTO_XCBC) += xcbc.o
67
obj-$(CONFIG_CRYPTO_NULL2) += crypto_null.o
L
Linus Torvalds 已提交
68 69
obj-$(CONFIG_CRYPTO_MD4) += md4.o
obj-$(CONFIG_CRYPTO_MD5) += md5.o
70
obj-$(CONFIG_CRYPTO_RMD160) += rmd160.o
71
obj-$(CONFIG_CRYPTO_RMD320) += rmd320.o
72 73
obj-$(CONFIG_CRYPTO_SHA1) += sha1_generic.o
obj-$(CONFIG_CRYPTO_SHA256) += sha256_generic.o
74
obj-$(CONFIG_CRYPTO_SHA512) += sha512_generic.o
75
obj-$(CONFIG_CRYPTO_SHA3) += sha3_generic.o
76
obj-$(CONFIG_CRYPTO_SM3) += sm3_generic.o
77
obj-$(CONFIG_CRYPTO_STREEBOG) += streebog_generic.o
L
Linus Torvalds 已提交
78
obj-$(CONFIG_CRYPTO_WP512) += wp512.o
79
CFLAGS_wp512.o := $(call cc-option,-fno-schedule-insns)  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149
80
obj-$(CONFIG_CRYPTO_BLAKE2B) += blake2b_generic.o
81
obj-$(CONFIG_CRYPTO_BLAKE2S) += blake2s_generic.o
82
obj-$(CONFIG_CRYPTO_GF128MUL) += gf128mul.o
83 84
obj-$(CONFIG_CRYPTO_ECB) += ecb.o
obj-$(CONFIG_CRYPTO_CBC) += cbc.o
85
obj-$(CONFIG_CRYPTO_CFB) += cfb.o
86
obj-$(CONFIG_CRYPTO_PCBC) += pcbc.o
87
obj-$(CONFIG_CRYPTO_CTS) += cts.o
88
obj-$(CONFIG_CRYPTO_LRW) += lrw.o
89
obj-$(CONFIG_CRYPTO_XTS) += xts.o
90
obj-$(CONFIG_CRYPTO_CTR) += ctr.o
91
obj-$(CONFIG_CRYPTO_KEYWRAP) += keywrap.o
92
obj-$(CONFIG_CRYPTO_ADIANTUM) += adiantum.o
93
obj-$(CONFIG_CRYPTO_NHPOLY1305) += nhpoly1305.o
M
Mikko Herranen 已提交
94
obj-$(CONFIG_CRYPTO_GCM) += gcm.o
J
Joy Latten 已提交
95
obj-$(CONFIG_CRYPTO_CCM) += ccm.o
96
obj-$(CONFIG_CRYPTO_CHACHA20POLY1305) += chacha20poly1305.o
97
obj-$(CONFIG_CRYPTO_AEGIS128) += aegis128.o
98
aegis128-y := aegis128-core.o
99 100

ifeq ($(ARCH),arm)
101
CFLAGS_aegis128-neon-inner.o += -ffreestanding -march=armv8-a -mfloat-abi=softfp
102 103 104 105
CFLAGS_aegis128-neon-inner.o += -mfpu=crypto-neon-fp-armv8
aegis128-$(CONFIG_CRYPTO_AEGIS128_SIMD) += aegis128-neon.o aegis128-neon-inner.o
endif
ifeq ($(ARCH),arm64)
106 107 108 109 110 111 112 113
aegis128-cflags-y := -ffreestanding -mcpu=generic+crypto
aegis128-cflags-$(CONFIG_CC_IS_GCC) += -ffixed-q16 -ffixed-q17 -ffixed-q18 \
				       -ffixed-q19 -ffixed-q20 -ffixed-q21 \
				       -ffixed-q22 -ffixed-q23 -ffixed-q24 \
				       -ffixed-q25 -ffixed-q26 -ffixed-q27 \
				       -ffixed-q28 -ffixed-q29 -ffixed-q30 \
				       -ffixed-q31
CFLAGS_aegis128-neon-inner.o += $(aegis128-cflags-y)
114 115 116 117
CFLAGS_REMOVE_aegis128-neon-inner.o += -mgeneral-regs-only
aegis128-$(CONFIG_CRYPTO_AEGIS128_SIMD) += aegis128-neon.o aegis128-neon-inner.o
endif

118
obj-$(CONFIG_CRYPTO_PCRYPT) += pcrypt.o
119
obj-$(CONFIG_CRYPTO_CRYPTD) += cryptd.o
120
obj-$(CONFIG_CRYPTO_DES) += des_generic.o
121
obj-$(CONFIG_CRYPTO_FCRYPT) += fcrypt.o
122
obj-$(CONFIG_CRYPTO_BLOWFISH) += blowfish_generic.o
123
obj-$(CONFIG_CRYPTO_BLOWFISH_COMMON) += blowfish_common.o
124
obj-$(CONFIG_CRYPTO_TWOFISH) += twofish_generic.o
125
obj-$(CONFIG_CRYPTO_TWOFISH_COMMON) += twofish_common.o
126
obj-$(CONFIG_CRYPTO_SERPENT) += serpent_generic.o
127
CFLAGS_serpent_generic.o := $(call cc-option,-fsched-pressure)  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149
128
obj-$(CONFIG_CRYPTO_AES) += aes_generic.o
129
CFLAGS_aes_generic.o := $(call cc-option,-fno-code-hoisting) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83356
130
obj-$(CONFIG_CRYPTO_SM4) += sm4_generic.o
131
obj-$(CONFIG_CRYPTO_AES_TI) += aes_ti.o
132
obj-$(CONFIG_CRYPTO_CAMELLIA) += camellia_generic.o
133
obj-$(CONFIG_CRYPTO_CAST_COMMON) += cast_common.o
134
obj-$(CONFIG_CRYPTO_CAST5) += cast5_generic.o
135
obj-$(CONFIG_CRYPTO_CAST6) += cast6_generic.o
L
Linus Torvalds 已提交
136 137 138 139
obj-$(CONFIG_CRYPTO_ARC4) += arc4.o
obj-$(CONFIG_CRYPTO_TEA) += tea.o
obj-$(CONFIG_CRYPTO_KHAZAD) += khazad.o
obj-$(CONFIG_CRYPTO_ANUBIS) += anubis.o
140
obj-$(CONFIG_CRYPTO_SEED) += seed.o
141
obj-$(CONFIG_CRYPTO_CHACHA20) += chacha_generic.o
142
obj-$(CONFIG_CRYPTO_POLY1305) += poly1305_generic.o
L
Linus Torvalds 已提交
143 144
obj-$(CONFIG_CRYPTO_DEFLATE) += deflate.o
obj-$(CONFIG_CRYPTO_MICHAEL_MIC) += michael_mic.o
145
obj-$(CONFIG_CRYPTO_CRC32C) += crc32c_generic.o
146
obj-$(CONFIG_CRYPTO_CRC32) += crc32_generic.o
147
obj-$(CONFIG_CRYPTO_CRCT10DIF) += crct10dif_common.o crct10dif_generic.o
148
obj-$(CONFIG_CRYPTO_AUTHENC) += authenc.o authencesn.o
149
obj-$(CONFIG_CRYPTO_LZO) += lzo.o lzo-rle.o
C
Chanho Min 已提交
150 151
obj-$(CONFIG_CRYPTO_LZ4) += lz4.o
obj-$(CONFIG_CRYPTO_LZ4HC) += lz4hc.o
152
obj-$(CONFIG_CRYPTO_XXHASH) += xxhash_generic.o
153
obj-$(CONFIG_CRYPTO_842) += 842.o
154
obj-$(CONFIG_CRYPTO_RNG2) += rng.o
155
obj-$(CONFIG_CRYPTO_ANSI_CPRNG) += ansi_cprng.o
156
obj-$(CONFIG_CRYPTO_DRBG) += drbg.o
157 158
obj-$(CONFIG_CRYPTO_JITTERENTROPY) += jitterentropy_rng.o
CFLAGS_jitterentropy.o = -O0
159 160
KASAN_SANITIZE_jitterentropy.o = n
UBSAN_SANITIZE_jitterentropy.o = n
161
jitterentropy_rng-y := jitterentropy.o jitterentropy-kcapi.o
L
Linus Torvalds 已提交
162
obj-$(CONFIG_CRYPTO_TEST) += tcrypt.o
163
obj-$(CONFIG_CRYPTO_GHASH) += ghash-generic.o
164
obj-$(CONFIG_CRYPTO_USER_API) += af_alg.o
165
obj-$(CONFIG_CRYPTO_USER_API_HASH) += algif_hash.o
166
obj-$(CONFIG_CRYPTO_USER_API_SKCIPHER) += algif_skcipher.o
167
obj-$(CONFIG_CRYPTO_USER_API_RNG) += algif_rng.o
168
obj-$(CONFIG_CRYPTO_USER_API_AEAD) += algif_aead.o
N
Nick Terrell 已提交
169
obj-$(CONFIG_CRYPTO_ZSTD) += zstd.o
170
obj-$(CONFIG_CRYPTO_OFB) += ofb.o
171
obj-$(CONFIG_CRYPTO_ECC) += ecc.o
172
obj-$(CONFIG_CRYPTO_ESSIV) += essiv.o
173
obj-$(CONFIG_CRYPTO_CURVE25519) += curve25519-generic.o
174

175 176 177 178
ecdh_generic-y += ecdh.o
ecdh_generic-y += ecdh_helper.o
obj-$(CONFIG_CRYPTO_ECDH) += ecdh_generic.o

179 180 181 182 183 184 185 186
$(obj)/ecrdsa_params.asn1.o: $(obj)/ecrdsa_params.asn1.c $(obj)/ecrdsa_params.asn1.h
$(obj)/ecrdsa_pub_key.asn1.o: $(obj)/ecrdsa_pub_key.asn1.c $(obj)/ecrdsa_pub_key.asn1.h
$(obj)/ecrdsa.o: $(obj)/ecrdsa_params.asn1.h $(obj)/ecrdsa_pub_key.asn1.h
ecrdsa_generic-y += ecrdsa.o
ecrdsa_generic-y += ecrdsa_params.asn1.o
ecrdsa_generic-y += ecrdsa_pub_key.asn1.o
obj-$(CONFIG_CRYPTO_ECRDSA) += ecrdsa_generic.o

187 188 189 190
#
# generic algorithms and the async_tx api
#
obj-$(CONFIG_XOR_BLOCKS) += xor.o
D
Dan Williams 已提交
191
obj-$(CONFIG_ASYNC_CORE) += async_tx/
192
obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/
193
obj-$(CONFIG_CRYPTO_HASH_INFO) += hash_info.o
194 195
crypto_simd-y := simd.o
obj-$(CONFIG_CRYPTO_SIMD) += crypto_simd.o