2 # Copyright (C) 2006-2011 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 CRYPTOIPSEC_MODULES
= \
38 crypto_confvar
=CONFIG_CRYPTO_
$(word 1,$(subst =,$(space
),$(1)))
39 crypto_file
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(LINUX_DIR
)/crypto
/$(word 2,$(subst =,$(space
),$(1))).ko
)
40 crypto_name
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(word 2,$(subst =,$(space
),$(1))))
42 # XXX: added CONFIG_CRYPTO_HMAC to KCONFIG so that CONFIG_CRYPTO_HASH is
43 # always set, even if no hash modules are selected
44 define KernelPackage
/crypto-core
45 SUBMENU
:=$(CRYPTO_MENU
)
46 TITLE
:=Core CryptoAPI modules
50 CONFIG_CRYPTO_ALGAPI \
51 $(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_confvar
,$(mod
)))
52 FILES
:=$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_file
,$(mod
)))
53 AUTOLOAD
:=$(call AutoLoad
,01,$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_name
,$(mod
))))
55 $(eval
$(call KernelPackage
,crypto-core
))
58 define AddDepends
/crypto
59 SUBMENU
:=$(CRYPTO_MENU
)
60 DEPENDS
+=kmod-crypto-core
$(1)
63 define KernelPackage
/crypto-hash
64 TITLE
:=CryptoAPI hash support
65 KCONFIG
:=CONFIG_CRYPTO_HASH
66 FILES
:=$(LINUX_DIR
)/crypto
/crypto_hash.ko
67 AUTOLOAD
:=$(call AutoLoad
,02,crypto_hash
)
68 $(call AddDepends
/crypto
)
70 $(eval
$(call KernelPackage
,crypto-hash
))
72 define KernelPackage
/crypto-manager
73 TITLE
:=CryptoAPI algorithm manager
74 DEPENDS
:=+kmod-crypto-hash
77 CONFIG_CRYPTO_BLKCIPHER \
78 CONFIG_CRYPTO_MANAGER \
79 $(foreach mod
,$(CRYPTOMGR_MODULES
),$(call crypto_confvar
,$(mod
)))
80 FILES
:=$(foreach mod
,$(CRYPTOMGR_MODULES
),$(call crypto_file
,$(mod
)))
81 AUTOLOAD
:=$(call AutoLoad
,03,$(foreach mod
,$(CRYPTOMGR_MODULES
),$(call crypto_name
,$(mod
))))
82 $(call AddDepends
/crypto
)
84 $(eval
$(call KernelPackage
,crypto-manager
))
86 define KernelPackage
/crypto-wq
87 TITLE
:=CryptoAPI work queue handling
88 KCONFIG
:=CONFIG_CRYPTO_WORKQUEUE
89 FILES
:=$(LINUX_DIR
)/crypto
/crypto_wq.ko
90 AUTOLOAD
:=$(call AutoLoad
,09,crypto_wq
)
91 $(call AddDepends
/crypto
)
93 $(eval
$(call KernelPackage
,crypto-wq
))
95 define KernelPackage
/crypto-rng
96 TITLE
:=CryptoAPI random number generation
97 KCONFIG
:=CONFIG_CRYPTO_RNG2
99 $(LINUX_DIR
)/crypto
/rng.ko \
100 $(LINUX_DIR
)/crypto
/krng.ko
101 AUTOLOAD
:=$(call AutoLoad
,09,rng krng
)
102 $(call AddDepends
/crypto
)
104 $(eval
$(call KernelPackage
,crypto-rng
))
106 define KernelPackage
/crypto-iv
107 TITLE
:=CryptoAPI initialization vectors
108 DEPENDS
:=+kmod-crypto-rng
+kmod-crypto-wq
109 KCONFIG
:= CONFIG_CRYPTO_BLKCIPHER2
111 $(LINUX_DIR
)/crypto
/eseqiv.ko \
112 $(LINUX_DIR
)/crypto
/chainiv.ko
113 AUTOLOAD
:=$(call AutoLoad
,10,eseqiv chainiv
)
114 $(call AddDepends
/crypto
)
116 $(eval
$(call KernelPackage
,crypto-iv
))
118 define KernelPackage
/crypto-ipsec
119 TITLE
:=IPSEC CryptoAPI modules
120 KCONFIG
:=$(foreach mod
,$(CRYPTOIPSEC_MODULES
),$(call crypto_confvar
,$(mod
)))
121 FILES
:=$(foreach mod
,$(CRYPTOIPSEC_MODULES
),$(call crypto_file
,$(mod
)))
122 AUTOLOAD
:=$(call AutoLoad
,09,$(foreach mod
,$(CRYPTOIPSEC_MODULES
),$(call crypto_name
,$(mod
))))
123 $(call AddDepends
/crypto
)
125 $(eval
$(call KernelPackage
,crypto-ipsec
))
127 define KernelPackage
/crypto-hw-padlock
128 TITLE
:=VIA PadLock ACE with AES
/SHA hw crypto module
129 DEPENDS
:=+kmod-crypto-aes
131 CONFIG_CRYPTO_DEV_PADLOCK \
132 CONFIG_CRYPTO_DEV_PADLOCK_AES \
133 CONFIG_CRYPTO_DEV_PADLOCK_SHA
135 $(LINUX_DIR
)/drivers
/crypto
/padlock-aes.ko \
136 $(LINUX_DIR
)/drivers
/crypto
/padlock-sha.ko
137 AUTOLOAD
:=$(call AutoLoad
,09,padlock-aes padlock-sha
)
138 $(call AddDepends
/crypto
)
141 $(eval
$(call KernelPackage
,crypto-hw-padlock
))
144 define KernelPackage
/crypto-hw-geode
145 TITLE
:=AMD Geode hardware crypto module
147 CONFIG_CRYPTO_DEV_GEODE
148 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/geode-aes.ko
149 AUTOLOAD
:=$(call AutoLoad
,09,geode-aes
)
150 $(call AddDepends
/crypto
)
153 $(eval
$(call KernelPackage
,crypto-hw-geode
))
156 define KernelPackage
/crypto-hw-hifn-795x
157 TITLE
:=HIFN
795x crypto accelerator
158 DEPENDS
:=@
!TARGET_ubicom32
161 CONFIG_CRYPTO_DEV_HIFN_795X \
162 CONFIG_CRYPTO_DEV_HIFN_795X_RNG
=y
163 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/hifn_795x.ko
164 AUTOLOAD
:=$(call AutoLoad
,09,hifn_795x
)
165 $(call AddDepends
/crypto
,+kmod-crypto-des
)
168 $(eval
$(call KernelPackage
,crypto-hw-hifn-795x
))
171 define KernelPackage
/crypto-hw-ixp4xx
172 TITLE
:=Intel IXP4xx hardware crypto module
173 DEPENDS
:=@TARGET_ixp4xx
175 CONFIG_CRYPTO_DEV_IXP4XX
176 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/ixp4xx_crypto.ko
177 AUTOLOAD
:=$(call AutoLoad
,90,ixp4xx_crypto
)
178 $(call AddDepends
/crypto
,+kmod-crypto-authenc
+kmod-crypto-des
)
181 define KernelPackage
/crypto-hw-ixp4xx
/description
182 Kernel support for the Intel IXP4xx HW crypto engine.
185 $(eval
$(call KernelPackage
,crypto-hw-ixp4xx
))
188 define KernelPackage
/crypto-hw-ppc4xx
189 TITLE
:=AMCC PPC4xx hardware crypto module
190 DEPENDS
:=@TARGET_ppc40x||TARGET_ppc44x
192 CONFIG_CRYPTO_DEV_PPC4XX
193 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/amcc
/crypto4xx.ko
194 AUTOLOAD
:=$(call AutoLoad
,90,crypto4xx
)
195 $(call AddDepends
/crypto
)
198 define KernelPackage
/crypto-hw-ppc4xx
/description
199 Kernel support for the AMCC PPC4xx HW crypto engine.
202 $(eval
$(call KernelPackage
,crypto-hw-ppc4xx
))
205 define KernelPackage
/crypto-aes
206 TITLE
:=AES cipher CryptoAPI module
207 KCONFIG
:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
208 FILES
:=$(LINUX_DIR
)/crypto
/aes
$(AES_SUFFIX
).ko
209 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
))
210 $(call AddDepends
/crypto
)
213 define KernelPackage
/crypto-aes
/x86
214 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/aes-i586.ko
215 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
) aes-i586
)
218 $(eval
$(call KernelPackage
,crypto-aes
))
221 define KernelPackage
/crypto-arc4
222 TITLE
:=ARC4
(RC4
) cipher CryptoAPI module
223 KCONFIG
:=CONFIG_CRYPTO_ARC4
224 FILES
:=$(LINUX_DIR
)/crypto
/arc4.ko
225 AUTOLOAD
:=$(call AutoLoad
,09,arc4
)
226 $(call AddDepends
/crypto
)
229 $(eval
$(call KernelPackage
,crypto-arc4
))
232 define KernelPackage
/crypto-authenc
233 TITLE
:=Combined mode wrapper for IPsec
234 DEPENDS
:=+kmod-crypto-manager
235 KCONFIG
:=CONFIG_CRYPTO_AUTHENC
236 FILES
:=$(LINUX_DIR
)/crypto
/authenc.ko
237 AUTOLOAD
:=$(call AutoLoad
,09,authenc
)
238 $(call AddDepends
/crypto
)
241 $(eval
$(call KernelPackage
,crypto-authenc
))
243 define KernelPackage
/crypto-cbc
244 TITLE
:=Cipher Block Chaining CryptoAPI module
245 DEPENDS
:=+kmod-crypto-manager
246 KCONFIG
:=CONFIG_CRYPTO_CBC
247 FILES
:=$(LINUX_DIR
)/crypto
/cbc.ko
248 AUTOLOAD
:=$(call AutoLoad
,09,cbc
)
249 $(call AddDepends
/crypto
)
252 $(eval
$(call KernelPackage
,crypto-cbc
))
254 define KernelPackage
/crypto-des
255 TITLE
:=DES
/3DES cipher CryptoAPI module
256 KCONFIG
:=CONFIG_CRYPTO_DES
257 FILES
:=$(LINUX_DIR
)/crypto
/des
$(DES_SUFFIX
).ko
258 AUTOLOAD
:=$(call AutoLoad
,09,des
$(DES_SUFFIX
))
259 $(call AddDepends
/crypto
)
262 $(eval
$(call KernelPackage
,crypto-des
))
264 define KernelPackage
/crypto-deflate
265 TITLE
:=Deflate compression CryptoAPI module
267 KCONFIG
:=CONFIG_CRYPTO_DEFLATE
268 FILES
:=$(LINUX_DIR
)/crypto
/deflate.ko
269 AUTOLOAD
:=$(call AutoLoad
,09,deflate
)
270 $(call AddDepends
/crypto
)
273 $(eval
$(call KernelPackage
,crypto-deflate
))
275 define KernelPackage
/crypto-ecb
276 TITLE
:=Electronic CodeBook CryptoAPI module
277 DEPENDS
:=+kmod-crypto-manager
278 KCONFIG
:=CONFIG_CRYPTO_ECB
279 FILES
:=$(LINUX_DIR
)/crypto
/ecb.ko
280 AUTOLOAD
:=$(call AutoLoad
,09,ecb
)
281 $(call AddDepends
/crypto
)
284 $(eval
$(call KernelPackage
,crypto-ecb
))
287 define KernelPackage
/crypto-hmac
288 TITLE
:=HMAC digest CryptoAPI module
289 DEPENDS
:=+kmod-crypto-hash
290 KCONFIG
:=CONFIG_CRYPTO_HMAC
291 FILES
:=$(LINUX_DIR
)/crypto
/hmac.ko
292 DEPENDS
:=+kmod-crypto-manager
293 AUTOLOAD
:=$(call AutoLoad
,09,hmac
)
294 $(call AddDepends
/crypto
)
297 $(eval
$(call KernelPackage
,crypto-hmac
))
300 define KernelPackage
/crypto-md5
301 TITLE
:=MD5 digest CryptoAPI module
302 DEPENDS
:=+kmod-crypto-hash
303 KCONFIG
:=CONFIG_CRYPTO_MD5
304 FILES
:=$(LINUX_DIR
)/crypto
/md5.ko
305 AUTOLOAD
:=$(call AutoLoad
,09,md5
)
306 $(call AddDepends
/crypto
)
309 $(eval
$(call KernelPackage
,crypto-md5
))
312 define KernelPackage
/crypto-michael-mic
313 TITLE
:=Michael MIC keyed digest CryptoAPI module
314 DEPENDS
:=+kmod-crypto-hash
315 KCONFIG
:=CONFIG_CRYPTO_MICHAEL_MIC
316 FILES
:=$(LINUX_DIR
)/crypto
/michael_mic.ko
317 AUTOLOAD
:=$(call AutoLoad
,09,michael_mic
)
318 $(call AddDepends
/crypto
)
321 $(eval
$(call KernelPackage
,crypto-michael-mic
))
324 define KernelPackage
/crypto-sha1
325 TITLE
:=SHA1 digest CryptoAPI module
326 DEPENDS
:=+kmod-crypto-hash
327 KCONFIG
:=CONFIG_CRYPTO_SHA1
328 FILES
:=$(LINUX_DIR
)/crypto
/sha1
$(SHA1_SUFFIX
).ko
329 AUTOLOAD
:=$(call AutoLoad
,09,sha1
$(SHA1_SUFFIX
))
330 $(call AddDepends
/crypto
)
333 $(eval
$(call KernelPackage
,crypto-sha1
))
336 define KernelPackage
/crypto-misc
337 TITLE
:=Other CryptoAPI modules
338 DEPENDS
:=+kmod-crypto-manager
340 CONFIG_CRYPTO_ANUBIS \
341 CONFIG_CRYPTO_BLOWFISH \
342 CONFIG_CRYPTO_CAMELLIA \
343 CONFIG_CRYPTO_CAST5 \
344 CONFIG_CRYPTO_CAST6 \
345 CONFIG_CRYPTO_CRC32C \
346 CONFIG_CRYPTO_FCRYPT \
347 CONFIG_CRYPTO_KHAZAD \
349 CONFIG_CRYPTO_SERPENT \
350 CONFIG_CRYPTO_SHA256 \
351 CONFIG_CRYPTO_SHA512 \
353 CONFIG_CRYPTO_TGR192 \
354 CONFIG_CRYPTO_TWOFISH \
355 CONFIG_CRYPTO_TWOFISH_COMMON \
356 CONFIG_CRYPTO_TWOFISH_586 \
359 $(LINUX_DIR
)/crypto
/anubis.ko \
360 $(LINUX_DIR
)/crypto
/blowfish.ko \
361 $(LINUX_DIR
)/crypto
/cast5.ko \
362 $(LINUX_DIR
)/crypto
/cast6.ko \
363 $(LINUX_DIR
)/crypto
/khazad.ko \
364 $(LINUX_DIR
)/crypto
/md4.ko \
365 $(LINUX_DIR
)/crypto
/serpent.ko \
366 $(LINUX_DIR
)/crypto
/sha256
$(SHA256_SUFFIX
).ko \
367 $(LINUX_DIR
)/crypto
/sha512
$(SHA512_SUFFIX
).ko \
368 $(LINUX_DIR
)/crypto
/tea.ko \
369 $(LINUX_DIR
)/crypto
/wp512.ko
370 ifeq ($(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),le
,2.6.35)),1)
371 FILES
+= $(LINUX_DIR
)/crypto
/twofish.ko
373 FILES
+= $(LINUX_DIR
)/crypto
/twofish_generic.ko
375 $(call AddDepends
/crypto
)
378 define KernelPackage
/crypto-misc
/2.6
380 $(LINUX_DIR
)/crypto
/camellia.ko \
381 $(if
$(findstring y
,$(CONFIG_CRYPTO_CRC32C
)),,$(LINUX_DIR
)/crypto
/crc32c.ko
) \
382 $(LINUX_DIR
)/crypto
/fcrypt.ko \
383 $(LINUX_DIR
)/crypto
/tgr192.ko \
384 $(LINUX_DIR
)/crypto
/twofish_common.ko
387 define KernelPackage
/crypto-misc
/x86
388 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/twofish-i586.ko
391 $(eval
$(call KernelPackage
,crypto-misc
))
394 define KernelPackage
/crypto-ocf
396 DEPENDS
:=+@OPENSSL_ENGINE @
!TARGET_uml
+kmod-crypto-manager
399 CONFIG_OCF_CRYPTODEV \
400 CONFIG_OCF_CRYPTOSOFT \
402 CONFIG_OCF_RANDOMHARVEST
=y
404 $(LINUX_DIR
)/crypto
/ocf
/ocf.ko \
405 $(LINUX_DIR
)/crypto
/ocf
/cryptodev.ko \
406 $(LINUX_DIR
)/crypto
/ocf
/cryptosoft.ko
407 AUTOLOAD
:=$(call AutoLoad
,09, \
412 $(call AddDepends
/crypto
)
415 $(eval
$(call KernelPackage
,crypto-ocf
))
418 define KernelPackage
/crypto-ocf-hifn7751
419 TITLE
:=OCF support for Hifn
6500/7751/7811/795x
, Invertex AEON and NetSec
7751 devices
420 DEPENDS
:=+@OPENSSL_ENGINE @PCI_SUPPORT @
!TARGET_uml kmod-crypto-ocf
421 KCONFIG
:=CONFIG_OCF_HIFN
422 FILES
:=$(LINUX_DIR
)/crypto
/ocf
/hifn
/hifn7751.ko
423 AUTOLOAD
:=$(call AutoLoad
,10,hifn7751
)
424 $(call AddDepends
/crypto
)
427 $(eval
$(call KernelPackage
,crypto-ocf-hifn7751
))
430 define KernelPackage
/crypto-ocf-hifnhipp
431 TITLE
:=OCF support for Hifn
7855/8155 devices
432 DEPENDS
:=+@OPENSSL_ENGINE @PCI_SUPPORT @
!TARGET_uml kmod-crypto-ocf
433 KCONFIG
:=CONFIG_OCF_HIFNHIPP
434 FILES
:=$(LINUX_DIR
)/crypto
/ocf
/hifn
/hifnHIPP.ko
435 AUTOLOAD
:=$(call AutoLoad
,10,hifnhipp
)
436 $(call AddDepends
/crypto
)
439 $(eval
$(call KernelPackage
,crypto-ocf-hifnhipp
))
442 define KernelPackage
/crypto-null
443 TITLE
:=Null CryptoAPI module
444 KCONFIG
:=CONFIG_CRYPTO_NULL
445 FILES
:=$(LINUX_DIR
)/crypto
/crypto_null.ko
446 AUTOLOAD
:=$(call AutoLoad
,09,crypto_null
)
447 $(call AddDepends
/crypto
)
450 $(eval
$(call KernelPackage
,crypto-null
))
453 define KernelPackage
/crypto-test
454 TITLE
:=Test CryptoAPI module
455 KCONFIG
:=CONFIG_CRYPTO_TEST
456 FILES
:=$(LINUX_DIR
)/crypto
/tcrypt.ko
457 $(call AddDepends
/crypto
)
460 $(eval
$(call KernelPackage
,crypto-test
))
463 define KernelPackage
/crypto-xts
464 TITLE
:=XTS cipher CryptoAPI module
465 DEPENDS
:=+kmod-crypto-manager
467 CONFIG_CRYPTO_GF128MUL \
470 $(LINUX_DIR
)/crypto
/xts.ko \
471 $(LINUX_DIR
)/crypto
/gf128mul.ko
472 AUTOLOAD
:=$(call AutoLoad
,09, \
476 $(call AddDepends
/crypto
)
479 $(eval
$(call KernelPackage
,crypto-xts
))
481 define KernelPackage
/crypto-mv-cesa
482 TITLE
:=Marvell crypto engine
483 DEPENDS
:=+kmod-crypto-manager @TARGET_kirkwood||TARGET_orion
484 KCONFIG
:=CONFIG_CRYPTO_DEV_MV_CESA
485 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/mv_cesa.ko
486 AUTOLOAD
:=$(call AutoLoad
,09,mv_cesa
)
487 $(call AddDepends
/crypto
)
490 $(eval
$(call KernelPackage
,crypto-mv-cesa
))