2 # Copyright (C) 2006-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 CRYPTO_MENU
:=Cryptographic API modules
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 CRYPTO_GENERIC
:=_generic
18 AES_SUFFIX
:=$(CRYPTO_GENERIC
)
19 DES_SUFFIX
:=$(CRYPTO_GENERIC
)
20 SHA1_SUFFIX
:=$(CRYPTO_GENERIC
)
21 SHA256_SUFFIX
:=$(CRYPTO_GENERIC
)
22 SHA512_SUFFIX
:=$(CRYPTO_GENERIC
)
24 CRYPTO_MODULES
= ALGAPI2
=crypto_algapi
29 BLKCIPHER2
=crypto_blkcipher
31 crypto_confvar
=CONFIG_CRYPTO_
$(word 1,$(subst =,$(space
),$(1)))
32 crypto_file
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(LINUX_DIR
)/crypto
/$(word 2,$(subst =,$(space
),$(1))).ko
)
33 crypto_name
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(word 2,$(subst =,$(space
),$(1))))
35 # XXX: added CONFIG_CRYPTO_HMAC to KCONFIG so that CONFIG_CRYPTO_HASH is
36 # always set, even if no hash modules are selected
37 define KernelPackage
/crypto-core
38 SUBMENU
:=$(CRYPTO_MENU
)
39 TITLE
:=Core CryptoAPI modules
43 CONFIG_CRYPTO_ALGAPI \
44 $(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_confvar
,$(mod
)))
45 FILES
:=$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_file
,$(mod
)))
46 AUTOLOAD
:=$(call AutoLoad
,01,$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_name
,$(mod
))))
48 $(eval
$(call KernelPackage
,crypto-core
))
51 define AddDepends
/crypto
52 SUBMENU
:=$(CRYPTO_MENU
)
53 DEPENDS
+=kmod-crypto-core
$(1)
56 define KernelPackage
/crypto-hash
57 TITLE
:=CryptoAPI hash support
58 KCONFIG
:=CONFIG_CRYPTO_HASH
59 FILES
:=$(LINUX_DIR
)/crypto
/crypto_hash.ko
60 AUTOLOAD
:=$(call AutoLoad
,02,crypto_hash
)
61 $(call AddDepends
/crypto
)
63 $(eval
$(call KernelPackage
,crypto-hash
))
65 define KernelPackage
/crypto-manager
66 TITLE
:=CryptoAPI algorithm manager
67 DEPENDS
:=+kmod-crypto-hash
70 CONFIG_CRYPTO_BLKCIPHER \
71 CONFIG_CRYPTO_MANAGER \
72 $(foreach mod
,$(CRYPTOMGR_MODULES
),$(call crypto_confvar
,$(mod
)))
73 FILES
:=$(foreach mod
,$(CRYPTOMGR_MODULES
),$(call crypto_file
,$(mod
)))
74 AUTOLOAD
:=$(call AutoLoad
,03,$(foreach mod
,$(CRYPTOMGR_MODULES
),$(call crypto_name
,$(mod
))))
75 $(call AddDepends
/crypto
)
77 $(eval
$(call KernelPackage
,crypto-manager
))
79 define KernelPackage
/crypto-hw-padlock
80 TITLE
:=VIA PadLock ACE with AES
/SHA hw crypto module
81 DEPENDS
:=+kmod-crypto-aes
83 CONFIG_CRYPTO_DEV_PADLOCK \
84 CONFIG_CRYPTO_DEV_PADLOCK_AES \
85 CONFIG_CRYPTO_DEV_PADLOCK_SHA
87 $(LINUX_DIR
)/drivers
/crypto
/padlock-aes.ko \
88 $(LINUX_DIR
)/drivers
/crypto
/padlock-sha.ko
89 AUTOLOAD
:=$(call AutoLoad
,09,padlock-aes padlock-sha
)
90 $(call AddDepends
/crypto
)
93 $(eval
$(call KernelPackage
,crypto-hw-padlock
))
96 define KernelPackage
/crypto-hw-geode
97 TITLE
:=AMD Geode hardware crypto module
99 CONFIG_CRYPTO_DEV_GEODE
100 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/geode-aes.ko
101 AUTOLOAD
:=$(call AutoLoad
,09,geode-aes
)
102 $(call AddDepends
/crypto
)
105 $(eval
$(call KernelPackage
,crypto-hw-geode
))
108 define KernelPackage
/crypto-hw-hifn-795x
109 TITLE
:=HIFN
795x crypto accelerator
110 DEPENDS
:=@
!TARGET_ubicom32
113 CONFIG_CRYPTO_DEV_HIFN_795X \
114 CONFIG_CRYPTO_DEV_HIFN_795X_RNG
=y
115 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/hifn_795x.ko
116 AUTOLOAD
:=$(call AutoLoad
,09,hifn_795x
)
117 $(call AddDepends
/crypto
,+kmod-crypto-des
)
120 $(eval
$(call KernelPackage
,crypto-hw-hifn-795x
))
123 define KernelPackage
/crypto-hw-ixp4xx
124 TITLE
:=Intel IXP4xx hardware crypto module
125 DEPENDS
:=@TARGET_ixp4xx
127 CONFIG_CRYPTO_DEV_IXP4XX
128 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/ixp4xx_crypto.ko
129 AUTOLOAD
:=$(call AutoLoad
,90,ixp4xx_crypto
)
130 $(call AddDepends
/crypto
,+kmod-crypto-authenc
+kmod-crypto-des
)
133 define KernelPackage
/crypto-hw-ixp4xx
/description
134 Kernel support for the Intel IXP4xx HW crypto engine.
137 $(eval
$(call KernelPackage
,crypto-hw-ixp4xx
))
140 define KernelPackage
/crypto-hw-ppc4xx
141 TITLE
:=AMCC PPC4xx hardware crypto module
142 DEPENDS
:=@TARGET_ppc40x||TARGET_ppc44x
144 CONFIG_CRYPTO_DEV_PPC4XX
145 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/amcc
/crypto4xx.ko
146 AUTOLOAD
:=$(call AutoLoad
,90,crypto4xx
)
147 $(call AddDepends
/crypto
)
150 define KernelPackage
/crypto-hw-ppc4xx
/description
151 Kernel support for the AMCC PPC4xx HW crypto engine.
154 $(eval
$(call KernelPackage
,crypto-hw-ppc4xx
))
157 define KernelPackage
/crypto-aes
158 TITLE
:=AES cipher CryptoAPI module
159 KCONFIG
:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
160 FILES
:=$(LINUX_DIR
)/crypto
/aes
$(AES_SUFFIX
).ko
161 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
))
162 $(call AddDepends
/crypto
)
165 define KernelPackage
/crypto-aes
/x86
166 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/aes-i586.ko
167 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
) aes-i586
)
170 $(eval
$(call KernelPackage
,crypto-aes
))
173 define KernelPackage
/crypto-arc4
174 TITLE
:=ARC4
(RC4
) cipher CryptoAPI module
175 KCONFIG
:=CONFIG_CRYPTO_ARC4
176 FILES
:=$(LINUX_DIR
)/crypto
/arc4.ko
177 AUTOLOAD
:=$(call AutoLoad
,09,arc4
)
178 $(call AddDepends
/crypto
)
181 $(eval
$(call KernelPackage
,crypto-arc4
))
184 define KernelPackage
/crypto-authenc
185 TITLE
:=Combined mode wrapper for IPsec
186 DEPENDS
:=+kmod-crypto-manager
187 KCONFIG
:=CONFIG_CRYPTO_AUTHENC
188 FILES
:=$(LINUX_DIR
)/crypto
/authenc.ko
189 AUTOLOAD
:=$(call AutoLoad
,09,authenc
)
190 $(call AddDepends
/crypto
)
193 $(eval
$(call KernelPackage
,crypto-authenc
))
195 define KernelPackage
/crypto-cbc
196 TITLE
:=Cipher Block Chaining CryptoAPI module
197 DEPENDS
:=+kmod-crypto-manager
198 KCONFIG
:=CONFIG_CRYPTO_CBC
199 FILES
:=$(LINUX_DIR
)/crypto
/cbc.ko
200 AUTOLOAD
:=$(call AutoLoad
,09,cbc
)
201 $(call AddDepends
/crypto
)
204 $(eval
$(call KernelPackage
,crypto-cbc
))
206 define KernelPackage
/crypto-des
207 TITLE
:=DES
/3DES cipher CryptoAPI module
208 KCONFIG
:=CONFIG_CRYPTO_DES
209 FILES
:=$(LINUX_DIR
)/crypto
/des
$(DES_SUFFIX
).ko
210 AUTOLOAD
:=$(call AutoLoad
,09,des
$(DES_SUFFIX
))
211 $(call AddDepends
/crypto
)
214 $(eval
$(call KernelPackage
,crypto-des
))
216 define KernelPackage
/crypto-deflate
217 TITLE
:=Deflate compression CryptoAPI module
218 KCONFIG
:=CONFIG_CRYPTO_DEFLATE
219 FILES
:=$(LINUX_DIR
)/crypto
/deflate.ko
220 AUTOLOAD
:=$(call AutoLoad
,09,deflate
)
221 $(call AddDepends
/crypto
)
224 $(eval
$(call KernelPackage
,crypto-deflate
))
226 define KernelPackage
/crypto-ecb
227 TITLE
:=Electronic CodeBook CryptoAPI module
228 DEPENDS
:=+kmod-crypto-manager
229 KCONFIG
:=CONFIG_CRYPTO_ECB
230 FILES
:=$(LINUX_DIR
)/crypto
/ecb.ko
231 AUTOLOAD
:=$(call AutoLoad
,09,ecb
)
232 $(call AddDepends
/crypto
)
235 $(eval
$(call KernelPackage
,crypto-ecb
))
238 define KernelPackage
/crypto-hmac
239 TITLE
:=HMAC digest CryptoAPI module
240 DEPENDS
:=+kmod-crypto-hash
241 KCONFIG
:=CONFIG_CRYPTO_HMAC
242 FILES
:=$(LINUX_DIR
)/crypto
/hmac.ko
243 DEPENDS
:=+kmod-crypto-manager
244 AUTOLOAD
:=$(call AutoLoad
,09,hmac
)
245 $(call AddDepends
/crypto
)
248 $(eval
$(call KernelPackage
,crypto-hmac
))
251 define KernelPackage
/crypto-md5
252 TITLE
:=MD5 digest CryptoAPI module
253 DEPENDS
:=+kmod-crypto-hash
254 KCONFIG
:=CONFIG_CRYPTO_MD5
255 FILES
:=$(LINUX_DIR
)/crypto
/md5.ko
256 AUTOLOAD
:=$(call AutoLoad
,09,md5
)
257 $(call AddDepends
/crypto
)
260 $(eval
$(call KernelPackage
,crypto-md5
))
263 define KernelPackage
/crypto-michael-mic
264 TITLE
:=Michael MIC keyed digest CryptoAPI module
265 DEPENDS
:=+kmod-crypto-hash
266 KCONFIG
:=CONFIG_CRYPTO_MICHAEL_MIC
267 FILES
:=$(LINUX_DIR
)/crypto
/michael_mic.ko
268 AUTOLOAD
:=$(call AutoLoad
,09,michael_mic
)
269 $(call AddDepends
/crypto
)
272 $(eval
$(call KernelPackage
,crypto-michael-mic
))
275 define KernelPackage
/crypto-sha1
276 TITLE
:=SHA1 digest CryptoAPI module
277 DEPENDS
:=+kmod-crypto-hash
278 KCONFIG
:=CONFIG_CRYPTO_SHA1
279 FILES
:=$(LINUX_DIR
)/crypto
/sha1
$(SHA1_SUFFIX
).ko
280 AUTOLOAD
:=$(call AutoLoad
,09,sha1
$(SHA1_SUFFIX
))
281 $(call AddDepends
/crypto
)
284 $(eval
$(call KernelPackage
,crypto-sha1
))
287 define KernelPackage
/crypto-misc
288 TITLE
:=Other CryptoAPI modules
289 DEPENDS
:=+kmod-crypto-manager
291 CONFIG_CRYPTO_ANUBIS \
292 CONFIG_CRYPTO_BLOWFISH \
293 CONFIG_CRYPTO_CAMELLIA \
294 CONFIG_CRYPTO_CAST5 \
295 CONFIG_CRYPTO_CAST6 \
296 CONFIG_CRYPTO_CRC32C \
297 CONFIG_CRYPTO_FCRYPT \
298 CONFIG_CRYPTO_KHAZAD \
300 CONFIG_CRYPTO_SERPENT \
301 CONFIG_CRYPTO_SHA256 \
302 CONFIG_CRYPTO_SHA512 \
304 CONFIG_CRYPTO_TGR192 \
305 CONFIG_CRYPTO_TWOFISH \
306 CONFIG_CRYPTO_TWOFISH_COMMON \
307 CONFIG_CRYPTO_TWOFISH_586 \
310 $(LINUX_DIR
)/crypto
/anubis.ko \
311 $(LINUX_DIR
)/crypto
/blowfish.ko \
312 $(LINUX_DIR
)/crypto
/cast5.ko \
313 $(LINUX_DIR
)/crypto
/cast6.ko \
314 $(LINUX_DIR
)/crypto
/khazad.ko \
315 $(LINUX_DIR
)/crypto
/md4.ko \
316 $(LINUX_DIR
)/crypto
/serpent.ko \
317 $(LINUX_DIR
)/crypto
/sha256
$(SHA256_SUFFIX
).ko \
318 $(LINUX_DIR
)/crypto
/sha512
$(SHA512_SUFFIX
).ko \
319 $(LINUX_DIR
)/crypto
/tea.ko \
320 $(if
$(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),le
,2.6.35)),,$(LINUX_DIR
)/crypto
/twofish.ko
) \
321 $(if
$(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),ge
,2.6.36)),,$(LINUX_DIR
)/crypto
/twofish_generic.ko
) \
322 $(LINUX_DIR
)/crypto
/wp512.ko
323 $(call AddDepends
/crypto
)
326 define KernelPackage
/crypto-misc
/2.6
328 $(LINUX_DIR
)/crypto
/camellia.ko \
329 $(if
$(findstring y
,$(CONFIG_CRYPTO_CRC32C
)),,$(LINUX_DIR
)/crypto
/crc32c.ko
) \
330 $(LINUX_DIR
)/crypto
/fcrypt.ko \
331 $(LINUX_DIR
)/crypto
/tgr192.ko \
332 $(LINUX_DIR
)/crypto
/twofish_common.ko
335 define KernelPackage
/crypto-misc
/x86
336 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/twofish-i586.ko
339 $(eval
$(call KernelPackage
,crypto-misc
))
342 define KernelPackage
/crypto-ocf
344 DEPENDS
:=+@OPENSSL_ENGINE @
!TARGET_uml
+kmod-crypto-manager
347 CONFIG_OCF_CRYPTODEV \
348 CONFIG_OCF_CRYPTOSOFT \
350 CONFIG_OCF_RANDOMHARVEST
=y
352 $(LINUX_DIR
)/crypto
/ocf
/ocf.ko \
353 $(LINUX_DIR
)/crypto
/ocf
/cryptodev.ko \
354 $(LINUX_DIR
)/crypto
/ocf
/cryptosoft.ko
355 AUTOLOAD
:=$(call AutoLoad
,09, \
360 $(call AddDepends
/crypto
)
363 $(eval
$(call KernelPackage
,crypto-ocf
))
366 define KernelPackage
/crypto-ocf-hifn7751
367 TITLE
:=OCF support for Hifn
6500/7751/7811/795x
, Invertex AEON and NetSec
7751 devices
368 DEPENDS
:=+@OPENSSL_ENGINE @PCI_SUPPORT @
!TARGET_uml kmod-crypto-ocf
369 KCONFIG
:=CONFIG_OCF_HIFN
370 FILES
:=$(LINUX_DIR
)/crypto
/ocf
/hifn
/hifn7751.ko
371 AUTOLOAD
:=$(call AutoLoad
,10,hifn7751
)
372 $(call AddDepends
/crypto
)
375 $(eval
$(call KernelPackage
,crypto-ocf-hifn7751
))
378 define KernelPackage
/crypto-ocf-hifnhipp
379 TITLE
:=OCF support for Hifn
7855/8155 devices
380 DEPENDS
:=+@OPENSSL_ENGINE @PCI_SUPPORT @
!TARGET_uml kmod-crypto-ocf
381 KCONFIG
:=CONFIG_OCF_HIFNHIPP
382 FILES
:=$(LINUX_DIR
)/crypto
/ocf
/hifn
/hifnHIPP.ko
383 AUTOLOAD
:=$(call AutoLoad
,10,hifnhipp
)
384 $(call AddDepends
/crypto
)
387 $(eval
$(call KernelPackage
,crypto-ocf-hifnhipp
))
390 define KernelPackage
/crypto-null
391 TITLE
:=Null CryptoAPI module
392 KCONFIG
:=CONFIG_CRYPTO_NULL
393 FILES
:=$(LINUX_DIR
)/crypto
/crypto_null.ko
394 AUTOLOAD
:=$(call AutoLoad
,09,crypto_null
)
395 $(call AddDepends
/crypto
)
398 $(eval
$(call KernelPackage
,crypto-null
))
401 define KernelPackage
/crypto-test
402 TITLE
:=Test CryptoAPI module
403 KCONFIG
:=CONFIG_CRYPTO_TEST
404 FILES
:=$(LINUX_DIR
)/crypto
/tcrypt.ko
405 $(call AddDepends
/crypto
)
408 $(eval
$(call KernelPackage
,crypto-test
))
411 define KernelPackage
/crypto-xts
412 TITLE
:=XTS cipher CryptoAPI module
413 DEPENDS
:=+kmod-crypto-manager
415 CONFIG_CRYPTO_GF128MUL \
418 $(LINUX_DIR
)/crypto
/xts.ko \
419 $(LINUX_DIR
)/crypto
/gf128mul.ko
420 AUTOLOAD
:=$(call AutoLoad
,09, \
424 $(call AddDepends
/crypto
)
427 $(eval
$(call KernelPackage
,crypto-xts
))
429 define KernelPackage
/crypto-mv-cesa
430 TITLE
:=Marvell crypto engine
431 DEPENDS
:=+kmod-crypto-manager @TARGET_kirkwood||TARGET_orion
432 KCONFIG
:=CONFIG_CRYPTO_DEV_MV_CESA
433 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/mv_cesa.ko
434 AUTOLOAD
:=$(call AutoLoad
,09,mv_cesa
)
435 $(call AddDepends
/crypto
)
438 $(eval
$(call KernelPackage
,crypto-mv-cesa
))