Hardware crypto modules require CONFIG_CRYPTO_HW=y to be set (#3883), thanks Norbert
[openwrt/svn-archive/archive.git] / package / kernel / modules / crypto.mk
1 #
2 # Copyright (C) 2006-2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 CRYPTO_MENU:=Cryptographic API modules
10
11 # XXX: added workarounds for modules renamed in 2.6 series:
12 # - aes > aes_generic (2.6.24)
13 # - blkcipher -> crypto_blkcipher (2.6.25)
14 # - des > des_generic (2.6.24)
15 # - sha1 > sha1_generic (2.6.24)
16 # - sha256 > sha256_generic (2.6.24)
17 # - sha512 > sha512_generic (2.6.26)
18 ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.24)),1)
19 CRYPTO_GENERIC:=_generic
20 AES_SUFFIX:=$(CRYPTO_GENERIC)
21 DES_SUFFIX:=$(CRYPTO_GENERIC)
22 SHA1_SUFFIX:=$(CRYPTO_GENERIC)
23 SHA256_SUFFIX:=$(CRYPTO_GENERIC)
24 endif
25 ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.25)),1)
26 CRYPTO_PREFIX:=crypto_
27 BLKCIPHER_PREFIX:=$(CRYPTO_PREFIX)
28 endif
29 ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.26)),1)
30 SHA512_SUFFIX:=$(CRYPTO_GENERIC)
31 endif
32
33 # XXX: added CONFIG_CRYPTO_HMAC to KCONFIG so that CONFIG_CRYPTO_HASH is
34 # always set, even if no hash modules are selected
35 define KernelPackage/crypto-core
36 SUBMENU:=$(CRYPTO_MENU)
37 TITLE:=Core CryptoAPI modules
38 KCONFIG:= \
39 CONFIG_CRYPTO=y \
40 CONFIG_CRYPTO_ALGAPI \
41 CONFIG_CRYPTO_BLKCIPHER \
42 CONFIG_CRYPTO_CBC \
43 CONFIG_CRYPTO_DEFLATE \
44 CONFIG_CRYPTO_ECB \
45 CONFIG_CRYPTO_HASH \
46 CONFIG_CRYPTO_HMAC \
47 CONFIG_CRYPTO_MANAGER
48 FILES:= \
49 $(LINUX_DIR)/crypto/crypto_algapi.$(LINUX_KMOD_SUFFIX) \
50 $(LINUX_DIR)/crypto/$(BLKCIPHER_PREFIX)blkcipher.$(LINUX_KMOD_SUFFIX) \
51 $(LINUX_DIR)/crypto/cbc.$(LINUX_KMOD_SUFFIX) \
52 $(LINUX_DIR)/crypto/deflate.$(LINUX_KMOD_SUFFIX) \
53 $(LINUX_DIR)/crypto/ecb.$(LINUX_KMOD_SUFFIX) \
54 $(LINUX_DIR)/crypto/crypto_hash.$(LINUX_KMOD_SUFFIX) \
55 $(LINUX_DIR)/crypto/cryptomgr.$(LINUX_KMOD_SUFFIX)
56 AUTOLOAD:=$(call AutoLoad,01, \
57 crypto_algapi \
58 cryptomgr \
59 crypto_hash \
60 $(BLKCIPHER_PREFIX)blkcipher \
61 cbc \
62 ecb \
63 deflate \
64 )
65 endef
66
67 define KernelPackage/crypto-core/2.4
68 FILES:=$(LINUX_DIR)/crypto/deflate.$(LINUX_KMOD_SUFFIX)
69 AUTOLOAD:=$(call AutoLoad,01, deflate)
70 endef
71
72 $(eval $(call KernelPackage,crypto-core))
73
74
75 define KernelPackage/crypto-hw-padlock
76 SUBMENU:=$(CRYPTO_MENU)
77 TITLE:=VIA PadLock ACE with AES/SHA hw crypto module
78 DEPENDS:=+kmod-crypto-core
79 KCONFIG:= \
80 CONFIG_CRYPTO_HW=y \
81 CONFIG_CRYPTO_DEV_PADLOCK \
82 CONFIG_CRYPTO_DEV_PADLOCK_AES \
83 CONFIG_CRYPTO_DEV_PADLOCK_SHA
84 FILES:= \
85 $(LINUX_DIR)/drivers/crypto/padlock-aes.$(LINUX_KMOD_SUFFIX) \
86 $(LINUX_DIR)/drivers/crypto/padlock-sha.$(LINUX_KMOD_SUFFIX)
87 AUTOLOAD:=$(call AutoLoad,09,padlock-aes padlock-sha)
88 endef
89
90 $(eval $(call KernelPackage,crypto-hw-padlock))
91
92
93 define KernelPackage/crypto-hw-geode
94 SUBMENU:=$(CRYPTO_MENU)
95 TITLE:=AMD Geode hardware crypto module
96 DEPENDS:=+kmod-crypto-core
97 KCONFIG:= \
98 CONFIG_CRYPTO_HW=y \
99 CONFIG_CRYPTO_DEV_GEODE
100 FILES:=$(LINUX_DIR)/drivers/crypto/geode-aes.$(LINUX_KMOD_SUFFIX)
101 AUTOLOAD:=$(call AutoLoad,09,geode-aes)
102 endef
103
104 $(eval $(call KernelPackage,crypto-hw-geode))
105
106
107 define KernelPackage/crypto-hw-hifn-795x
108 SUBMENU:=$(CRYPTO_MENU)
109 TITLE:=HIFN 795x crypto accelerator
110 DEPENDS:=+kmod-crypto-core +kmod-crypto-des
111 KCONFIG:= \
112 CONFIG_CRYPTO_HW=y \
113 CONFIG_CRYPTO_DEV_HIFN_795X \
114 CONFIG_CRYPTO_DEV_HIFN_795X_RNG=y
115 FILES:=$(LINUX_DIR)/drivers/crypto/hifn_795x.$(LINUX_KMOD_SUFFIX)
116 AUTOLOAD:=$(call AutoLoad,09,hifn_795x)
117 endef
118
119 $(eval $(call KernelPackage,crypto-hw-hifn-795x))
120
121
122 define KernelPackage/crypto-hw-ixp4xx
123 SUBMENU:=$(CRYPTO_MENU)
124 TITLE:=Intel IXP4xx hardware crypto module
125 DEPENDS:= \
126 @TARGET_ixp4xx +kmod-crypto-core +kmod-crypto-des +kmod-crypto-aead \
127 +kmod-crypto-authenc
128 KCONFIG:= CONFIG_CRYPTO_DEV_IXP4XX
129 FILES:=$(LINUX_DIR)/drivers/crypto/ixp4xx_crypto.$(LINUX_KMOD_SUFFIX)
130 AUTOLOAD:=$(call AutoLoad,90,ixp4xx_crypto)
131 endef
132
133 define KernelPackage/crypto-hw-ixp4xx/description
134 Kernel support for the Intel IXP4xx HW crypto engine.
135 endef
136
137 $(eval $(call KernelPackage,crypto-hw-ixp4xx))
138
139
140 define KernelPackage/crypto-aes
141 SUBMENU:=$(CRYPTO_MENU)
142 TITLE:=AES cipher CryptoAPI module
143 DEPENDS:=+kmod-crypto-core
144 KCONFIG:=CONFIG_CRYPTO_AES
145 FILES:=$(LINUX_DIR)/crypto/aes$(AES_SUFFIX).$(LINUX_KMOD_SUFFIX)
146 AUTOLOAD:=$(call AutoLoad,09,aes$(AES_SUFFIX))
147 endef
148
149 define KernelPackage/crypto-aes/x86-2.6
150 KCONFIG+=CONFIG_CRYPTO_AES_586
151 FILES+=$(LINUX_DIR)/arch/x86/crypto/aes-i586.$(LINUX_KMOD_SUFFIX)
152 AUTOLOAD:=$(call AutoLoad,09,aes$(AES_SUFFIX) aes-i586)
153 endef
154
155 $(eval $(call KernelPackage,crypto-aes))
156
157
158 define KernelPackage/crypto-arc4
159 SUBMENU:=$(CRYPTO_MENU)
160 TITLE:=ARC4 (RC4) cipher CryptoAPI module
161 DEPENDS:=+kmod-crypto-core
162 KCONFIG:=CONFIG_CRYPTO_ARC4
163 FILES:=$(LINUX_DIR)/crypto/arc4.$(LINUX_KMOD_SUFFIX)
164 AUTOLOAD:=$(call AutoLoad,09,arc4)
165 endef
166
167 $(eval $(call KernelPackage,crypto-arc4))
168
169
170 define KernelPackage/crypto-aead
171 SUBMENU:=$(CRYPTO_MENU)
172 TITLE:=Authenticated Encryption with Associated Data
173 DEPENDS:=+kmod-crypto-core
174 KCONFIG:=CONFIG_CRYPTO_AEAD
175 FILES:=$(LINUX_DIR)/crypto/aead.$(LINUX_KMOD_SUFFIX)
176 AUTOLOAD:=$(call AutoLoad,09,aead)
177 endef
178
179 $(eval $(call KernelPackage,crypto-aead))
180
181 define KernelPackage/crypto-authenc
182 SUBMENU:=$(CRYPTO_MENU)
183 TITLE:=Combined mode wrapper for IPsec
184 DEPENDS:=+kmod-crypto-core +kmod-crypto-aead
185 KCONFIG:=CONFIG_CRYPTO_AUTHENC
186 FILES:=$(LINUX_DIR)/crypto/authenc.$(LINUX_KMOD_SUFFIX)
187 AUTOLOAD:=$(call AutoLoad,09,authenc)
188 endef
189
190 $(eval $(call KernelPackage,crypto-authenc))
191
192 define KernelPackage/crypto-des
193 SUBMENU:=$(CRYPTO_MENU)
194 TITLE:=DES/3DES cipher CryptoAPI module
195 DEPENDS:=+kmod-crypto-core
196 KCONFIG:=CONFIG_CRYPTO_DES
197 FILES:=$(LINUX_DIR)/crypto/des$(DES_SUFFIX).$(LINUX_KMOD_SUFFIX)
198 AUTOLOAD:=$(call AutoLoad,09,des$(DES_SUFFIX))
199 endef
200
201 $(eval $(call KernelPackage,crypto-des))
202
203
204 define KernelPackage/crypto-hmac
205 SUBMENU:=$(CRYPTO_MENU)
206 TITLE:=HMAC digest CryptoAPI module
207 DEPENDS:=+kmod-crypto-core
208 KCONFIG:=CONFIG_CRYPTO_HMAC
209 FILES:=$(LINUX_DIR)/crypto/hmac.$(LINUX_KMOD_SUFFIX)
210 AUTOLOAD:=$(call AutoLoad,09,hmac)
211 endef
212
213 $(eval $(call KernelPackage,crypto-hmac))
214
215
216 define KernelPackage/crypto-md5
217 SUBMENU:=$(CRYPTO_MENU)
218 TITLE:=MD5 digest CryptoAPI module
219 DEPENDS:=+kmod-crypto-core
220 KCONFIG:=CONFIG_CRYPTO_MD5
221 FILES:=$(LINUX_DIR)/crypto/md5.$(LINUX_KMOD_SUFFIX)
222 AUTOLOAD:=$(call AutoLoad,09,md5)
223 endef
224
225 $(eval $(call KernelPackage,crypto-md5))
226
227
228 define KernelPackage/crypto-michael-mic
229 SUBMENU:=$(CRYPTO_MENU)
230 TITLE:=Michael MIC keyed digest CryptoAPI module
231 DEPENDS:=+kmod-crypto-core
232 KCONFIG:=CONFIG_CRYPTO_MICHAEL_MIC
233 FILES:=$(LINUX_DIR)/crypto/michael_mic.$(LINUX_KMOD_SUFFIX)
234 AUTOLOAD:=$(call AutoLoad,09,michael_mic)
235 endef
236
237 $(eval $(call KernelPackage,crypto-michael-mic))
238
239
240 define KernelPackage/crypto-sha1
241 SUBMENU:=$(CRYPTO_MENU)
242 TITLE:=SHA1 digest CryptoAPI module
243 DEPENDS:=+kmod-crypto-core
244 KCONFIG:=CONFIG_CRYPTO_SHA1
245 FILES:=$(LINUX_DIR)/crypto/sha1$(SHA1_SUFFIX).$(LINUX_KMOD_SUFFIX)
246 AUTOLOAD:=$(call AutoLoad,09,sha1$(SHA1_SUFFIX))
247 endef
248
249 $(eval $(call KernelPackage,crypto-sha1))
250
251
252 define KernelPackage/crypto-misc
253 SUBMENU:=$(CRYPTO_MENU)
254 TITLE:=Other CryptoAPI modules
255 DEPENDS:=+kmod-crypto-core
256 KCONFIG:= \
257 CONFIG_CRYPTO_ANUBIS \
258 CONFIG_CRYPTO_BLOWFISH \
259 CONFIG_CRYPTO_CAMELLIA \
260 CONFIG_CRYPTO_CAST5 \
261 CONFIG_CRYPTO_CAST6 \
262 CONFIG_CRYPTO_CRC32C \
263 CONFIG_CRYPTO_FCRYPT \
264 CONFIG_CRYPTO_KHAZAD \
265 CONFIG_CRYPTO_MD4 \
266 CONFIG_CRYPTO_SERPENT \
267 CONFIG_CRYPTO_SHA256 \
268 CONFIG_CRYPTO_SHA512 \
269 CONFIG_CRYPTO_TEA \
270 CONFIG_CRYPTO_TGR192 \
271 CONFIG_CRYPTO_TWOFISH \
272 CONFIG_CRYPTO_TWOFISH_586 \
273 CONFIG_CRYPTO_WP512
274 FILES:= \
275 $(LINUX_DIR)/crypto/anubis.$(LINUX_KMOD_SUFFIX) \
276 $(LINUX_DIR)/crypto/blowfish.$(LINUX_KMOD_SUFFIX) \
277 $(LINUX_DIR)/crypto/cast5.$(LINUX_KMOD_SUFFIX) \
278 $(LINUX_DIR)/crypto/cast6.$(LINUX_KMOD_SUFFIX) \
279 $(LINUX_DIR)/crypto/khazad.$(LINUX_KMOD_SUFFIX) \
280 $(LINUX_DIR)/crypto/md4.$(LINUX_KMOD_SUFFIX) \
281 $(LINUX_DIR)/crypto/serpent.$(LINUX_KMOD_SUFFIX) \
282 $(LINUX_DIR)/crypto/sha256$(SHA256_SUFFIX).$(LINUX_KMOD_SUFFIX) \
283 $(LINUX_DIR)/crypto/sha512$(SHA512_SUFFIX).$(LINUX_KMOD_SUFFIX) \
284 $(LINUX_DIR)/crypto/tea.$(LINUX_KMOD_SUFFIX) \
285 $(LINUX_DIR)/crypto/twofish.$(LINUX_KMOD_SUFFIX) \
286 $(LINUX_DIR)/crypto/wp512.$(LINUX_KMOD_SUFFIX)
287 endef
288
289 define KernelPackage/crypto-misc/2.6
290 FILES+= \
291 $(LINUX_DIR)/crypto/camellia.$(LINUX_KMOD_SUFFIX) \
292 $(LINUX_DIR)/crypto/crc32c.$(LINUX_KMOD_SUFFIX) \
293 $(LINUX_DIR)/crypto/fcrypt.$(LINUX_KMOD_SUFFIX) \
294 $(LINUX_DIR)/crypto/tgr192.$(LINUX_KMOD_SUFFIX)
295 endef
296
297 $(eval $(call KernelPackage,crypto-misc))
298
299 define KernelPackage/crypto-ocf
300 SUBMENU:=$(CRYPTO_MENU)
301 TITLE:=OCF modules
302 DEPENDS:=+kmod-crypto-core @!TARGET_uml
303 KCONFIG:= \
304 CONFIG_OCF_OCF \
305 CONFIG_OCF_CRYPTODEV \
306 CONFIG_OCF_CRYPTOSOFT \
307 CONFIG_OCF_FIPS=y \
308 CONFIG_OCF_RANDOMHARVEST=y
309 FILES:= \
310 $(LINUX_DIR)/crypto/ocf/ocf.$(LINUX_KMOD_SUFFIX) \
311 $(LINUX_DIR)/crypto/ocf/cryptodev.$(LINUX_KMOD_SUFFIX) \
312 $(LINUX_DIR)/crypto/ocf/cryptosoft.$(LINUX_KMOD_SUFFIX)
313 AUTOLOAD:=$(call AutoLoad,09, \
314 ocf \
315 cryptodev \
316 cryptosoft \
317 )
318 endef
319
320 $(eval $(call KernelPackage,crypto-ocf))
321
322
323 define KernelPackage/crypto-null
324 SUBMENU:=$(CRYPTO_MENU)
325 TITLE:=Null CryptoAPI module
326 DEPENDS:=+kmod-crypto-core
327 KCONFIG:=CONFIG_CRYPTO_NULL
328 FILES:=$(LINUX_DIR)/crypto/crypto_null.$(LINUX_KMOD_SUFFIX)
329 AUTOLOAD:=$(call AutoLoad,09,crypto_null)
330 endef
331
332 $(eval $(call KernelPackage,crypto-null))
333
334
335 define KernelPackage/crypto-test
336 SUBMENU:=$(CRYPTO_MENU)
337 TITLE:=Test CryptoAPI module
338 DEPENDS:=+kmod-crypto-core
339 KCONFIG:=CONFIG_CRYPTO_TEST
340 FILES:=$(LINUX_DIR)/crypto/tcrypt.$(LINUX_KMOD_SUFFIX)
341 endef
342
343 $(eval $(call KernelPackage,crypto-test))
344