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