move aead into crypto-core
[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_AEAD \
41 CONFIG_CRYPTO_ALGAPI \
42 CONFIG_CRYPTO_BLKCIPHER \
43 CONFIG_CRYPTO_CBC \
44 CONFIG_CRYPTO_DEFLATE \
45 CONFIG_CRYPTO_ECB \
46 CONFIG_CRYPTO_HASH \
47 CONFIG_CRYPTO_HMAC \
48 CONFIG_CRYPTO_MANAGER
49 FILES:= \
50 $(LINUX_DIR)/crypto/crypto_algapi.$(LINUX_KMOD_SUFFIX) \
51 $(LINUX_DIR)/crypto/aead.$(LINUX_KMOD_SUFFIX) \
52 $(LINUX_DIR)/crypto/$(BLKCIPHER_PREFIX)blkcipher.$(LINUX_KMOD_SUFFIX) \
53 $(LINUX_DIR)/crypto/cbc.$(LINUX_KMOD_SUFFIX) \
54 $(LINUX_DIR)/crypto/deflate.$(LINUX_KMOD_SUFFIX) \
55 $(LINUX_DIR)/crypto/ecb.$(LINUX_KMOD_SUFFIX) \
56 $(LINUX_DIR)/crypto/crypto_hash.$(LINUX_KMOD_SUFFIX) \
57 $(LINUX_DIR)/crypto/cryptomgr.$(LINUX_KMOD_SUFFIX)
58 AUTOLOAD:=$(call AutoLoad,01, \
59 crypto_algapi \
60 cryptomgr \
61 crypto_hash \
62 $(BLKCIPHER_PREFIX)blkcipher \
63 cbc \
64 ecb \
65 deflate \
66 )
67 endef
68
69 define KernelPackage/crypto-core/2.4
70 FILES:=$(LINUX_DIR)/crypto/deflate.$(LINUX_KMOD_SUFFIX)
71 AUTOLOAD:=$(call AutoLoad,01, deflate)
72 endef
73
74 $(eval $(call KernelPackage,crypto-core))
75
76
77 define KernelPackage/crypto-hw-padlock
78 SUBMENU:=$(CRYPTO_MENU)
79 TITLE:=VIA PadLock ACE with AES/SHA hw crypto module
80 DEPENDS:=+kmod-crypto-core
81 KCONFIG:= \
82 CONFIG_CRYPTO_HW=y \
83 CONFIG_CRYPTO_DEV_PADLOCK \
84 CONFIG_CRYPTO_DEV_PADLOCK_AES \
85 CONFIG_CRYPTO_DEV_PADLOCK_SHA
86 FILES:= \
87 $(LINUX_DIR)/drivers/crypto/padlock-aes.$(LINUX_KMOD_SUFFIX) \
88 $(LINUX_DIR)/drivers/crypto/padlock-sha.$(LINUX_KMOD_SUFFIX)
89 AUTOLOAD:=$(call AutoLoad,09,padlock-aes padlock-sha)
90 endef
91
92 $(eval $(call KernelPackage,crypto-hw-padlock))
93
94
95 define KernelPackage/crypto-hw-geode
96 SUBMENU:=$(CRYPTO_MENU)
97 TITLE:=AMD Geode hardware crypto module
98 DEPENDS:=+kmod-crypto-core
99 KCONFIG:= \
100 CONFIG_CRYPTO_HW=y \
101 CONFIG_CRYPTO_DEV_GEODE
102 FILES:=$(LINUX_DIR)/drivers/crypto/geode-aes.$(LINUX_KMOD_SUFFIX)
103 AUTOLOAD:=$(call AutoLoad,09,geode-aes)
104 endef
105
106 $(eval $(call KernelPackage,crypto-hw-geode))
107
108
109 define KernelPackage/crypto-hw-hifn-795x
110 SUBMENU:=$(CRYPTO_MENU)
111 TITLE:=HIFN 795x crypto accelerator
112 DEPENDS:=+kmod-crypto-core +kmod-crypto-des
113 KCONFIG:= \
114 CONFIG_CRYPTO_HW=y \
115 CONFIG_CRYPTO_DEV_HIFN_795X \
116 CONFIG_CRYPTO_DEV_HIFN_795X_RNG=y
117 FILES:=$(LINUX_DIR)/drivers/crypto/hifn_795x.$(LINUX_KMOD_SUFFIX)
118 AUTOLOAD:=$(call AutoLoad,09,hifn_795x)
119 endef
120
121 $(eval $(call KernelPackage,crypto-hw-hifn-795x))
122
123
124 define KernelPackage/crypto-hw-ixp4xx
125 SUBMENU:=$(CRYPTO_MENU)
126 TITLE:=Intel IXP4xx hardware crypto module
127 DEPENDS:= \
128 @TARGET_ixp4xx +kmod-crypto-core +kmod-crypto-des +kmod-crypto-authenc
129 KCONFIG:= CONFIG_CRYPTO_DEV_IXP4XX
130 FILES:=$(LINUX_DIR)/drivers/crypto/ixp4xx_crypto.$(LINUX_KMOD_SUFFIX)
131 AUTOLOAD:=$(call AutoLoad,90,ixp4xx_crypto)
132 endef
133
134 define KernelPackage/crypto-hw-ixp4xx/description
135 Kernel support for the Intel IXP4xx HW crypto engine.
136 endef
137
138 $(eval $(call KernelPackage,crypto-hw-ixp4xx))
139
140
141 define KernelPackage/crypto-aes
142 SUBMENU:=$(CRYPTO_MENU)
143 TITLE:=AES cipher CryptoAPI module
144 DEPENDS:=+kmod-crypto-core
145 KCONFIG:=CONFIG_CRYPTO_AES
146 FILES:=$(LINUX_DIR)/crypto/aes$(AES_SUFFIX).$(LINUX_KMOD_SUFFIX)
147 AUTOLOAD:=$(call AutoLoad,09,aes$(AES_SUFFIX))
148 endef
149
150 define KernelPackage/crypto-aes/x86-2.6
151 KCONFIG+=CONFIG_CRYPTO_AES_586
152 FILES+=$(LINUX_DIR)/arch/x86/crypto/aes-i586.$(LINUX_KMOD_SUFFIX)
153 AUTOLOAD:=$(call AutoLoad,09,aes$(AES_SUFFIX) aes-i586)
154 endef
155
156 $(eval $(call KernelPackage,crypto-aes))
157
158
159 define KernelPackage/crypto-arc4
160 SUBMENU:=$(CRYPTO_MENU)
161 TITLE:=ARC4 (RC4) cipher CryptoAPI module
162 DEPENDS:=+kmod-crypto-core
163 KCONFIG:=CONFIG_CRYPTO_ARC4
164 FILES:=$(LINUX_DIR)/crypto/arc4.$(LINUX_KMOD_SUFFIX)
165 AUTOLOAD:=$(call AutoLoad,09,arc4)
166 endef
167
168 $(eval $(call KernelPackage,crypto-arc4))
169
170
171 define KernelPackage/crypto-authenc
172 SUBMENU:=$(CRYPTO_MENU)
173 TITLE:=Combined mode wrapper for IPsec
174 DEPENDS:=+kmod-crypto-core
175 KCONFIG:=CONFIG_CRYPTO_AUTHENC
176 FILES:=$(LINUX_DIR)/crypto/authenc.$(LINUX_KMOD_SUFFIX)
177 AUTOLOAD:=$(call AutoLoad,09,authenc)
178 endef
179
180 $(eval $(call KernelPackage,crypto-authenc))
181
182 define KernelPackage/crypto-des
183 SUBMENU:=$(CRYPTO_MENU)
184 TITLE:=DES/3DES cipher CryptoAPI module
185 DEPENDS:=+kmod-crypto-core
186 KCONFIG:=CONFIG_CRYPTO_DES
187 FILES:=$(LINUX_DIR)/crypto/des$(DES_SUFFIX).$(LINUX_KMOD_SUFFIX)
188 AUTOLOAD:=$(call AutoLoad,09,des$(DES_SUFFIX))
189 endef
190
191 $(eval $(call KernelPackage,crypto-des))
192
193
194 define KernelPackage/crypto-hmac
195 SUBMENU:=$(CRYPTO_MENU)
196 TITLE:=HMAC digest CryptoAPI module
197 DEPENDS:=+kmod-crypto-core
198 KCONFIG:=CONFIG_CRYPTO_HMAC
199 FILES:=$(LINUX_DIR)/crypto/hmac.$(LINUX_KMOD_SUFFIX)
200 AUTOLOAD:=$(call AutoLoad,09,hmac)
201 endef
202
203 $(eval $(call KernelPackage,crypto-hmac))
204
205
206 define KernelPackage/crypto-md5
207 SUBMENU:=$(CRYPTO_MENU)
208 TITLE:=MD5 digest CryptoAPI module
209 DEPENDS:=+kmod-crypto-core
210 KCONFIG:=CONFIG_CRYPTO_MD5
211 FILES:=$(LINUX_DIR)/crypto/md5.$(LINUX_KMOD_SUFFIX)
212 AUTOLOAD:=$(call AutoLoad,09,md5)
213 endef
214
215 $(eval $(call KernelPackage,crypto-md5))
216
217
218 define KernelPackage/crypto-michael-mic
219 SUBMENU:=$(CRYPTO_MENU)
220 TITLE:=Michael MIC keyed digest CryptoAPI module
221 DEPENDS:=+kmod-crypto-core
222 KCONFIG:=CONFIG_CRYPTO_MICHAEL_MIC
223 FILES:=$(LINUX_DIR)/crypto/michael_mic.$(LINUX_KMOD_SUFFIX)
224 AUTOLOAD:=$(call AutoLoad,09,michael_mic)
225 endef
226
227 $(eval $(call KernelPackage,crypto-michael-mic))
228
229
230 define KernelPackage/crypto-sha1
231 SUBMENU:=$(CRYPTO_MENU)
232 TITLE:=SHA1 digest CryptoAPI module
233 DEPENDS:=+kmod-crypto-core
234 KCONFIG:=CONFIG_CRYPTO_SHA1
235 FILES:=$(LINUX_DIR)/crypto/sha1$(SHA1_SUFFIX).$(LINUX_KMOD_SUFFIX)
236 AUTOLOAD:=$(call AutoLoad,09,sha1$(SHA1_SUFFIX))
237 endef
238
239 $(eval $(call KernelPackage,crypto-sha1))
240
241
242 define KernelPackage/crypto-misc
243 SUBMENU:=$(CRYPTO_MENU)
244 TITLE:=Other CryptoAPI modules
245 DEPENDS:=+kmod-crypto-core
246 KCONFIG:= \
247 CONFIG_CRYPTO_ANUBIS \
248 CONFIG_CRYPTO_BLOWFISH \
249 CONFIG_CRYPTO_CAMELLIA \
250 CONFIG_CRYPTO_CAST5 \
251 CONFIG_CRYPTO_CAST6 \
252 CONFIG_CRYPTO_CRC32C \
253 CONFIG_CRYPTO_FCRYPT \
254 CONFIG_CRYPTO_KHAZAD \
255 CONFIG_CRYPTO_MD4 \
256 CONFIG_CRYPTO_SERPENT \
257 CONFIG_CRYPTO_SHA256 \
258 CONFIG_CRYPTO_SHA512 \
259 CONFIG_CRYPTO_TEA \
260 CONFIG_CRYPTO_TGR192 \
261 CONFIG_CRYPTO_TWOFISH \
262 CONFIG_CRYPTO_TWOFISH_586 \
263 CONFIG_CRYPTO_WP512
264 FILES:= \
265 $(LINUX_DIR)/crypto/anubis.$(LINUX_KMOD_SUFFIX) \
266 $(LINUX_DIR)/crypto/blowfish.$(LINUX_KMOD_SUFFIX) \
267 $(LINUX_DIR)/crypto/cast5.$(LINUX_KMOD_SUFFIX) \
268 $(LINUX_DIR)/crypto/cast6.$(LINUX_KMOD_SUFFIX) \
269 $(LINUX_DIR)/crypto/khazad.$(LINUX_KMOD_SUFFIX) \
270 $(LINUX_DIR)/crypto/md4.$(LINUX_KMOD_SUFFIX) \
271 $(LINUX_DIR)/crypto/serpent.$(LINUX_KMOD_SUFFIX) \
272 $(LINUX_DIR)/crypto/sha256$(SHA256_SUFFIX).$(LINUX_KMOD_SUFFIX) \
273 $(LINUX_DIR)/crypto/sha512$(SHA512_SUFFIX).$(LINUX_KMOD_SUFFIX) \
274 $(LINUX_DIR)/crypto/tea.$(LINUX_KMOD_SUFFIX) \
275 $(LINUX_DIR)/crypto/twofish.$(LINUX_KMOD_SUFFIX) \
276 $(LINUX_DIR)/crypto/wp512.$(LINUX_KMOD_SUFFIX)
277 endef
278
279 define KernelPackage/crypto-misc/2.6
280 FILES+= \
281 $(LINUX_DIR)/crypto/camellia.$(LINUX_KMOD_SUFFIX) \
282 $(LINUX_DIR)/crypto/crc32c.$(LINUX_KMOD_SUFFIX) \
283 $(LINUX_DIR)/crypto/fcrypt.$(LINUX_KMOD_SUFFIX) \
284 $(LINUX_DIR)/crypto/tgr192.$(LINUX_KMOD_SUFFIX)
285 endef
286
287 $(eval $(call KernelPackage,crypto-misc))
288
289 define KernelPackage/crypto-ocf
290 SUBMENU:=$(CRYPTO_MENU)
291 TITLE:=OCF modules
292 DEPENDS:=+kmod-crypto-core @!TARGET_uml
293 KCONFIG:= \
294 CONFIG_OCF_OCF \
295 CONFIG_OCF_CRYPTODEV \
296 CONFIG_OCF_CRYPTOSOFT \
297 CONFIG_OCF_FIPS=y \
298 CONFIG_OCF_RANDOMHARVEST=y
299 FILES:= \
300 $(LINUX_DIR)/crypto/ocf/ocf.$(LINUX_KMOD_SUFFIX) \
301 $(LINUX_DIR)/crypto/ocf/cryptodev.$(LINUX_KMOD_SUFFIX) \
302 $(LINUX_DIR)/crypto/ocf/cryptosoft.$(LINUX_KMOD_SUFFIX)
303 AUTOLOAD:=$(call AutoLoad,09, \
304 ocf \
305 cryptodev \
306 cryptosoft \
307 )
308 endef
309
310 $(eval $(call KernelPackage,crypto-ocf))
311
312
313 define KernelPackage/crypto-null
314 SUBMENU:=$(CRYPTO_MENU)
315 TITLE:=Null CryptoAPI module
316 DEPENDS:=+kmod-crypto-core
317 KCONFIG:=CONFIG_CRYPTO_NULL
318 FILES:=$(LINUX_DIR)/crypto/crypto_null.$(LINUX_KMOD_SUFFIX)
319 AUTOLOAD:=$(call AutoLoad,09,crypto_null)
320 endef
321
322 $(eval $(call KernelPackage,crypto-null))
323
324
325 define KernelPackage/crypto-test
326 SUBMENU:=$(CRYPTO_MENU)
327 TITLE:=Test CryptoAPI module
328 DEPENDS:=+kmod-crypto-core
329 KCONFIG:=CONFIG_CRYPTO_TEST
330 FILES:=$(LINUX_DIR)/crypto/tcrypt.$(LINUX_KMOD_SUFFIX)
331 endef
332
333 $(eval $(call KernelPackage,crypto-test))
334