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
11 ALGAPI2=crypto_algapi \
12 BLKCIPHER2=crypto_blkcipher
14 crypto_confvar=CONFIG_CRYPTO_$(word 1,$(subst =,$(space),$(1)))
15 crypto_file=$(LINUX_DIR)/crypto/$(word 2,$(subst =,$(space),$(1))).ko
16 crypto_name=$(if $(findstring y,$($(call crypto_confvar,$(1)))),,$(word 2,$(subst =,$(space),$(1))))
18 define KernelPackage/crypto-core
19 SUBMENU:=$(CRYPTO_MENU)
20 TITLE:=Core CryptoAPI modules
24 CONFIG_CRYPTO_BLKCIPHER \
25 CONFIG_CRYPTO_ALGAPI \
26 $(foreach mod,$(CRYPTO_MODULES),$(call crypto_confvar,$(mod)))
27 FILES:=$(foreach mod,$(CRYPTO_MODULES),$(call crypto_file,$(mod)))
30 $(eval $(call KernelPackage,crypto-core))
33 define AddDepends/crypto
34 SUBMENU:=$(CRYPTO_MENU)
35 DEPENDS+=+kmod-crypto-core $(1)
38 define KernelPackage/crypto-aead
39 TITLE:=CryptoAPI AEAD support
43 FILES:=$(LINUX_DIR)/crypto/aead.ko
44 AUTOLOAD:=$(call AutoLoad,09,crypto_aead,1)
45 $(call AddDepends/crypto)
48 $(eval $(call KernelPackage,crypto-aead))
51 define KernelPackage/crypto-hash
52 TITLE:=CryptoAPI hash support
53 KCONFIG:=CONFIG_CRYPTO_HASH
54 FILES:=$(LINUX_DIR)/crypto/crypto_hash.ko
55 AUTOLOAD:=$(call AutoLoad,02,crypto_hash,1)
56 $(call AddDepends/crypto)
59 $(eval $(call KernelPackage,crypto-hash))
62 define KernelPackage/crypto-manager
63 TITLE:=CryptoAPI algorithm manager
64 DEPENDS:=+kmod-crypto-aead +kmod-crypto-hash +kmod-crypto-pcompress
66 CONFIG_CRYPTO_MANAGER \
67 CONFIG_CRYPTO_MANAGER2
68 FILES:=$(LINUX_DIR)/crypto/cryptomgr.ko
69 $(call AddDepends/crypto)
72 $(eval $(call KernelPackage,crypto-manager))
75 define KernelPackage/crypto-pcompress
76 TITLE:=CryptoAPI Partial (de)compression operations
78 CONFIG_CRYPTO_PCOMP=y \
80 FILES:=$(LINUX_DIR)/crypto/pcompress.ko
81 AUTOLOAD:=$(call AutoLoad,09,pcompress)
82 $(call AddDepends/crypto)
85 $(eval $(call KernelPackage,crypto-pcompress))
88 define KernelPackage/crypto-user
89 TITLE:=CryptoAPI userspace interface
90 DEPENDS:=+kmod-crypto-hash +kmod-crypto-manager
92 CONFIG_CRYPTO_USER_API \
93 CONFIG_CRYPTO_USER_API_HASH \
94 CONFIG_CRYPTO_USER_API_SKCIPHER
96 $(LINUX_DIR)/crypto/af_alg.ko \
97 $(LINUX_DIR)/crypto/algif_hash.ko \
98 $(LINUX_DIR)/crypto/algif_skcipher.ko
99 AUTOLOAD:=$(call AutoLoad,09,af_alg algif_hash algif_skcipher)
100 $(call AddDepends/crypto)
103 $(eval $(call KernelPackage,crypto-user))
106 define KernelPackage/crypto-wq
107 TITLE:=CryptoAPI work queue handling
108 KCONFIG:=CONFIG_CRYPTO_WORKQUEUE
109 FILES:=$(LINUX_DIR)/crypto/crypto_wq.ko
110 AUTOLOAD:=$(call AutoLoad,09,crypto_wq)
111 $(call AddDepends/crypto)
113 $(eval $(call KernelPackage,crypto-wq))
115 define KernelPackage/crypto-rng
116 TITLE:=CryptoAPI random number generation
117 KCONFIG:=CONFIG_CRYPTO_RNG2
119 $(LINUX_DIR)/crypto/rng.ko \
120 $(LINUX_DIR)/crypto/krng.ko
121 AUTOLOAD:=$(call AutoLoad,09,rng krng)
122 $(call AddDepends/crypto)
125 $(eval $(call KernelPackage,crypto-rng))
128 define KernelPackage/crypto-iv
129 TITLE:=CryptoAPI initialization vectors
130 DEPENDS:=+kmod-crypto-manager +kmod-crypto-rng +kmod-crypto-wq
131 KCONFIG:= CONFIG_CRYPTO_BLKCIPHER2
133 $(LINUX_DIR)/crypto/eseqiv.ko \
134 $(LINUX_DIR)/crypto/chainiv.ko
135 AUTOLOAD:=$(call AutoLoad,10,eseqiv chainiv)
136 $(call AddDepends/crypto)
139 $(eval $(call KernelPackage,crypto-iv))
141 define KernelPackage/crypto-seqiv
142 TITLE:=CryptoAPI Sequence Number IV Generator
143 DEPENDS:=+kmod-crypto-aead +kmod-crypto-rng
144 KCONFIG:=CONFIG_CRYPTO_SEQIV
145 FILES:=$(LINUX_DIR)/crypto/seqiv.ko
146 AUTOLOAD:=$(call AutoLoad,09,seqiv)
147 $(call AddDepends/crypto)
150 $(eval $(call KernelPackage,crypto-seqiv))
153 define KernelPackage/crypto-hw-talitos
154 TITLE:=Freescale integrated security engine (SEC) driver
155 DEPENDS:=+kmod-crypto-aes +kmod-crypto-manager +kmod-crypto-hash +kmod-random-core +kmod-crypto-authenc
157 CONFIG_CRYPTO_DEV_TALITOS
159 $(LINUX_DIR)/drivers/crypto/talitos.ko
160 AUTOLOAD:=$(call AutoLoad,09,talitos)
161 $(call AddDepends/crypto)
164 $(eval $(call KernelPackage,crypto-hw-talitos))
167 define KernelPackage/crypto-hw-padlock
168 TITLE:=VIA PadLock ACE with AES/SHA hw crypto module
169 DEPENDS:=+kmod-crypto-aes +kmod-crypto-manager
171 CONFIG_CRYPTO_DEV_PADLOCK \
172 CONFIG_CRYPTO_DEV_PADLOCK_AES \
173 CONFIG_CRYPTO_DEV_PADLOCK_SHA
175 $(LINUX_DIR)/drivers/crypto/padlock-aes.ko \
176 $(LINUX_DIR)/drivers/crypto/padlock-sha.ko
177 AUTOLOAD:=$(call AutoLoad,09,padlock-aes padlock-sha)
178 $(call AddDepends/crypto)
181 $(eval $(call KernelPackage,crypto-hw-padlock))
184 define KernelPackage/crypto-hw-geode
185 TITLE:=AMD Geode hardware crypto module
186 DEPENDS:=+kmod-crypto-manager
188 CONFIG_CRYPTO_DEV_GEODE
189 FILES:=$(LINUX_DIR)/drivers/crypto/geode-aes.ko
190 AUTOLOAD:=$(call AutoLoad,09,geode-aes)
191 $(call AddDepends/crypto)
194 $(eval $(call KernelPackage,crypto-hw-geode))
197 define KernelPackage/crypto-hw-hifn-795x
198 TITLE:=HIFN 795x crypto accelerator
199 DEPENDS:=+kmod-random-core +kmod-crypto-manager
201 CONFIG_CRYPTO_DEV_HIFN_795X \
202 CONFIG_CRYPTO_DEV_HIFN_795X_RNG=y
203 FILES:=$(LINUX_DIR)/drivers/crypto/hifn_795x.ko
204 AUTOLOAD:=$(call AutoLoad,09,hifn_795x)
205 $(call AddDepends/crypto,+kmod-crypto-des)
208 $(eval $(call KernelPackage,crypto-hw-hifn-795x))
211 define KernelPackage/crypto-hw-ppc4xx
212 TITLE:=AMCC PPC4xx hardware crypto module
213 DEPENDS:=@TARGET_ppc40x||TARGET_ppc44x
215 CONFIG_CRYPTO_DEV_PPC4XX
216 FILES:=$(LINUX_DIR)/drivers/crypto/amcc/crypto4xx.ko
217 AUTOLOAD:=$(call AutoLoad,90,crypto4xx)
218 $(call AddDepends/crypto,+kmod-crypto-manager +kmod-crypto-hash)
221 define KernelPackage/crypto-hw-ppc4xx/description
222 Kernel support for the AMCC PPC4xx HW crypto engine.
225 $(eval $(call KernelPackage,crypto-hw-ppc4xx))
228 define KernelPackage/crypto-hw-omap
229 TITLE:=TI OMAP hardware crypto modules
230 DEPENDS:=@TARGET_omap
232 CONFIG_CRYPTO_DEV_OMAP_AES \
233 CONFIG_CRYPTO_DEV_OMAP_DES \
234 CONFIG_CRYPTO_DEV_OMAP_SHAM
235 ifneq ($(wildcard $(LINUX_DIR)/drivers/crypto/omap-des.ko),)
237 $(LINUX_DIR)/drivers/crypto/omap-aes.ko \
238 $(LINUX_DIR)/drivers/crypto/omap-des.ko \
239 $(LINUX_DIR)/drivers/crypto/omap-sham.ko
240 AUTOLOAD:=$(call AutoLoad,90,omap-aes omap-des omap-sham)
243 $(LINUX_DIR)/drivers/crypto/omap-aes.ko \
244 $(LINUX_DIR)/drivers/crypto/omap-sham.ko
245 AUTOLOAD:=$(call AutoLoad,90,omap-aes omap-sham)
247 $(call AddDepends/crypto,+kmod-crypto-manager +kmod-crypto-hash)
250 define KernelPackage/crypto-hw-omap/description
251 Kernel support for the TI OMAP HW crypto engine.
254 $(eval $(call KernelPackage,crypto-hw-omap))
257 define KernelPackage/crypto-aes
258 TITLE:=AES cipher CryptoAPI module
259 KCONFIG:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
260 FILES:=$(LINUX_DIR)/crypto/aes_generic.ko
261 AUTOLOAD:=$(call AutoLoad,09,aes_generic)
262 $(call AddDepends/crypto)
265 define KernelPackage/crypto-aes/x86
266 FILES+=$(LINUX_DIR)/arch/x86/crypto/aes-i586.ko
267 AUTOLOAD:=$(call AutoLoad,09,aes-i586)
270 $(eval $(call KernelPackage,crypto-aes))
273 define KernelPackage/crypto-arc4
274 TITLE:=ARC4 (RC4) cipher CryptoAPI module
275 KCONFIG:=CONFIG_CRYPTO_ARC4
276 FILES:=$(LINUX_DIR)/crypto/arc4.ko
277 AUTOLOAD:=$(call AutoLoad,09,arc4)
278 $(call AddDepends/crypto)
281 $(eval $(call KernelPackage,crypto-arc4))
284 define KernelPackage/crypto-authenc
285 TITLE:=Combined mode wrapper for IPsec
286 DEPENDS:=+kmod-crypto-manager
287 KCONFIG:=CONFIG_CRYPTO_AUTHENC
288 FILES:=$(LINUX_DIR)/crypto/authenc.ko
289 AUTOLOAD:=$(call AutoLoad,09,authenc)
290 $(call AddDepends/crypto)
293 $(eval $(call KernelPackage,crypto-authenc))
295 define KernelPackage/crypto-cbc
296 TITLE:=Cipher Block Chaining CryptoAPI module
297 DEPENDS:=+kmod-crypto-manager
298 KCONFIG:=CONFIG_CRYPTO_CBC
299 FILES:=$(LINUX_DIR)/crypto/cbc.ko
300 AUTOLOAD:=$(call AutoLoad,09,cbc)
301 $(call AddDepends/crypto)
304 $(eval $(call KernelPackage,crypto-cbc))
306 define KernelPackage/crypto-pcbc
307 TITLE:=Propagating Cipher Block Chaining CryptoAPI module
308 DEPENDS:=+kmod-crypto-manager
309 KCONFIG:=CONFIG_CRYPTO_PCBC
310 FILES:=$(LINUX_DIR)/crypto/pcbc.ko
311 AUTOLOAD:=$(call AutoLoad,09,pcbc)
312 $(call AddDepends/crypto)
315 $(eval $(call KernelPackage,crypto-pcbc))
317 define KernelPackage/crypto-crc32c
318 TITLE:=CRC32c CRC module
319 DEPENDS:=+kmod-crypto-hash
320 KCONFIG:=CONFIG_CRYPTO_CRC32C
321 ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,3.15.0)),1)
322 FILES:=$(LINUX_DIR)/crypto/crc32c_generic.ko
323 AUTOLOAD:=$(call AutoLoad,04,crc32c_generic,1)
325 FILES:=$(LINUX_DIR)/crypto/crc32c.ko
326 AUTOLOAD:=$(call AutoLoad,04,crc32c,1)
328 $(call AddDepends/crypto)
331 $(eval $(call KernelPackage,crypto-crc32c))
334 define KernelPackage/crypto-des
335 TITLE:=DES/3DES cipher CryptoAPI module
336 KCONFIG:=CONFIG_CRYPTO_DES
337 FILES:=$(LINUX_DIR)/crypto/des_generic.ko
338 AUTOLOAD:=$(call AutoLoad,09,des_generic)
339 $(call AddDepends/crypto)
342 $(eval $(call KernelPackage,crypto-des))
345 define KernelPackage/crypto-deflate
346 TITLE:=Deflate compression CryptoAPI module
347 DEPENDS:=+kmod-lib-zlib
348 KCONFIG:=CONFIG_CRYPTO_DEFLATE
349 FILES:=$(LINUX_DIR)/crypto/deflate.ko
350 AUTOLOAD:=$(call AutoLoad,09,deflate)
351 $(call AddDepends/crypto)
354 $(eval $(call KernelPackage,crypto-deflate))
357 define KernelPackage/crypto-fcrypt
358 TITLE:=FCRYPT cipher CryptoAPI module
359 KCONFIG:=CONFIG_CRYPTO_FCRYPT
360 FILES:=$(LINUX_DIR)/crypto/fcrypt.ko
361 AUTOLOAD:=$(call AutoLoad,09,fcrypt)
362 $(call AddDepends/crypto)
365 $(eval $(call KernelPackage,crypto-fcrypt))
367 define KernelPackage/crypto-ecb
368 TITLE:=Electronic CodeBook CryptoAPI module
369 DEPENDS:=+kmod-crypto-manager
370 KCONFIG:=CONFIG_CRYPTO_ECB
371 FILES:=$(LINUX_DIR)/crypto/ecb.ko
372 AUTOLOAD:=$(call AutoLoad,09,ecb)
373 $(call AddDepends/crypto)
376 $(eval $(call KernelPackage,crypto-ecb))
379 define KernelPackage/crypto-hmac
380 TITLE:=HMAC digest CryptoAPI module
381 DEPENDS:=+kmod-crypto-hash
382 KCONFIG:=CONFIG_CRYPTO_HMAC
383 FILES:=$(LINUX_DIR)/crypto/hmac.ko
384 DEPENDS:=+kmod-crypto-manager
385 AUTOLOAD:=$(call AutoLoad,09,hmac)
386 $(call AddDepends/crypto)
389 $(eval $(call KernelPackage,crypto-hmac))
392 define KernelPackage/crypto-md4
393 TITLE:=MD4 digest CryptoAPI module
394 DEPENDS:=+kmod-crypto-hash
395 KCONFIG:=CONFIG_CRYPTO_MD4
396 FILES:=$(LINUX_DIR)/crypto/md4.ko
397 AUTOLOAD:=$(call AutoLoad,09,md4)
398 $(call AddDepends/crypto)
401 $(eval $(call KernelPackage,crypto-md4))
404 define KernelPackage/crypto-md5
405 TITLE:=MD5 digest CryptoAPI module
406 DEPENDS:=+kmod-crypto-hash
407 KCONFIG:=CONFIG_CRYPTO_MD5
408 FILES:=$(LINUX_DIR)/crypto/md5.ko
409 AUTOLOAD:=$(call AutoLoad,09,md5)
410 $(call AddDepends/crypto)
413 $(eval $(call KernelPackage,crypto-md5))
416 define KernelPackage/crypto-michael-mic
417 TITLE:=Michael MIC keyed digest CryptoAPI module
418 DEPENDS:=+kmod-crypto-hash
419 KCONFIG:=CONFIG_CRYPTO_MICHAEL_MIC
420 FILES:=$(LINUX_DIR)/crypto/michael_mic.ko
421 AUTOLOAD:=$(call AutoLoad,09,michael_mic)
422 $(call AddDepends/crypto)
425 $(eval $(call KernelPackage,crypto-michael-mic))
428 define KernelPackage/crypto-sha1
429 TITLE:=SHA1 digest CryptoAPI module
430 DEPENDS:=+kmod-crypto-hash
431 KCONFIG:=CONFIG_CRYPTO_SHA1
432 FILES:=$(LINUX_DIR)/crypto/sha1_generic.ko
433 AUTOLOAD:=$(call AutoLoad,09,sha1_generic)
434 $(call AddDepends/crypto)
437 $(eval $(call KernelPackage,crypto-sha1))
440 define KernelPackage/crypto-sha256
441 TITLE:=SHA224 SHA256 digest CryptoAPI module
442 DEPENDS:=+kmod-crypto-hash
443 KCONFIG:=CONFIG_CRYPTO_SHA256
444 FILES:=$(LINUX_DIR)/crypto/sha256_generic.ko
445 AUTOLOAD:=$(call AutoLoad,09,sha256_generic)
446 $(call AddDepends/crypto)
449 $(eval $(call KernelPackage,crypto-sha256))
452 ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,3.6.0)),1)
453 camellia_mod_suffix=_generic
455 ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,3.7.0)),1)
456 cast56_mod_suffix=_generic
459 define KernelPackage/crypto-misc
460 TITLE:=Other CryptoAPI modules
461 DEPENDS:=+kmod-crypto-manager
463 CONFIG_CRYPTO_ANUBIS \
464 CONFIG_CRYPTO_BLOWFISH \
465 CONFIG_CRYPTO_CAMELLIA \
466 CONFIG_CRYPTO_CAST5 \
467 CONFIG_CRYPTO_CAST6 \
468 CONFIG_CRYPTO_FCRYPT \
469 CONFIG_CRYPTO_KHAZAD \
470 CONFIG_CRYPTO_SERPENT \
471 CONFIG_CRYPTO_SHA512 \
473 CONFIG_CRYPTO_TGR192 \
474 CONFIG_CRYPTO_TWOFISH \
475 CONFIG_CRYPTO_TWOFISH_COMMON \
476 CONFIG_CRYPTO_TWOFISH_586 \
479 $(LINUX_DIR)/crypto/anubis.ko \
480 $(LINUX_DIR)/crypto/camellia$(camellia_mod_suffix).ko \
481 $(if $(call kernel_patchver_ge,3.7),$(LINUX_DIR)/crypto/cast_common.ko) \
482 $(LINUX_DIR)/crypto/cast5$(cast56_mod_suffix).ko \
483 $(LINUX_DIR)/crypto/cast6$(cast56_mod_suffix).ko \
484 $(LINUX_DIR)/crypto/khazad.ko \
485 $(LINUX_DIR)/crypto/sha512_generic.ko \
486 $(LINUX_DIR)/crypto/tea.ko \
487 $(LINUX_DIR)/crypto/tgr192.ko \
488 $(LINUX_DIR)/crypto/twofish_common.ko \
489 $(LINUX_DIR)/crypto/wp512.ko \
490 $(LINUX_DIR)/crypto/twofish_generic.ko \
491 $(LINUX_DIR)/crypto/blowfish_common.ko \
492 $(LINUX_DIR)/crypto/blowfish_generic.ko \
493 $(LINUX_DIR)/crypto/serpent_generic.ko
494 $(call AddDepends/crypto)
497 define KernelPackage/crypto-misc/x86
498 FILES+=$(LINUX_DIR)/arch/x86/crypto/twofish-i586.ko
501 $(eval $(call KernelPackage,crypto-misc))
504 define KernelPackage/crypto-ocf
506 DEPENDS:=+@OPENSSL_ENGINE_CRYPTO @!TARGET_uml +kmod-crypto-manager
509 CONFIG_OCF_CRYPTODEV \
510 CONFIG_OCF_CRYPTOSOFT \
512 CONFIG_OCF_RANDOMHARVEST=y
514 $(LINUX_DIR)/crypto/ocf/ocf.ko \
515 $(LINUX_DIR)/crypto/ocf/cryptodev.ko \
516 $(LINUX_DIR)/crypto/ocf/cryptosoft.ko
517 AUTOLOAD:=$(call AutoLoad,09, \
522 $(call AddDepends/crypto)
525 $(eval $(call KernelPackage,crypto-ocf))
528 define KernelPackage/crypto-ocf-hifn7751
529 TITLE:=OCF support for Hifn 6500/7751/7811/795x, Invertex AEON and NetSec 7751 devices
530 DEPENDS:=+@OPENSSL_ENGINE_CRYPTO @PCI_SUPPORT @!TARGET_uml kmod-crypto-ocf
531 KCONFIG:=CONFIG_OCF_HIFN
532 FILES:=$(LINUX_DIR)/crypto/ocf/hifn/hifn7751.ko
533 AUTOLOAD:=$(call AutoLoad,10,hifn7751)
534 $(call AddDepends/crypto)
537 $(eval $(call KernelPackage,crypto-ocf-hifn7751))
540 define KernelPackage/crypto-ocf-hifnhipp
541 TITLE:=OCF support for Hifn 7855/8155 devices
542 DEPENDS:=+@OPENSSL_ENGINE_CRYPTO @PCI_SUPPORT @!TARGET_uml kmod-crypto-ocf
543 KCONFIG:=CONFIG_OCF_HIFNHIPP
544 FILES:=$(LINUX_DIR)/crypto/ocf/hifn/hifnHIPP.ko
545 AUTOLOAD:=$(call AutoLoad,10,hifnHIPP)
546 $(call AddDepends/crypto)
549 $(eval $(call KernelPackage,crypto-ocf-hifnhipp))
552 define KernelPackage/crypto-null
553 TITLE:=Null CryptoAPI module
554 KCONFIG:=CONFIG_CRYPTO_NULL
555 FILES:=$(LINUX_DIR)/crypto/crypto_null.ko
556 AUTOLOAD:=$(call AutoLoad,09,crypto_null)
557 $(call AddDepends/crypto,+kmod-crypto-manager)
560 $(eval $(call KernelPackage,crypto-null))
563 define KernelPackage/crypto-test
564 TITLE:=Test CryptoAPI module
565 KCONFIG:=CONFIG_CRYPTO_TEST
566 FILES:=$(LINUX_DIR)/crypto/tcrypt.ko
567 $(call AddDepends/crypto,+kmod-crypto-manager)
570 $(eval $(call KernelPackage,crypto-test))
573 define KernelPackage/crypto-xts
574 TITLE:=XTS cipher CryptoAPI module
575 DEPENDS:=+kmod-crypto-manager
577 CONFIG_CRYPTO_GF128MUL \
580 $(LINUX_DIR)/crypto/xts.ko \
581 $(LINUX_DIR)/crypto/gf128mul.ko
582 AUTOLOAD:=$(call AutoLoad,09, \
586 $(call AddDepends/crypto)
589 $(eval $(call KernelPackage,crypto-xts))
592 define KernelPackage/crypto-mv-cesa
593 TITLE:=Marvell crypto engine
594 DEPENDS:=+kmod-crypto-manager +kmod-crypto-aes @TARGET_kirkwood||TARGET_orion||TARGET_mvebu
595 KCONFIG:=CONFIG_CRYPTO_DEV_MV_CESA
596 FILES:=$(LINUX_DIR)/drivers/crypto/mv_cesa.ko
597 AUTOLOAD:=$(call AutoLoad,09,mv_cesa)
598 $(call AddDepends/crypto)
601 $(eval $(call KernelPackage,crypto-mv-cesa))