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 CRYPTO_MODULES
= ALGAPI2
=crypto_algapi
15 BLKCIPHER2
=crypto_blkcipher
17 crypto_confvar
=CONFIG_CRYPTO_
$(word 1,$(subst =,$(space
),$(1)))
18 crypto_file
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(LINUX_DIR
)/crypto
/$(word 2,$(subst =,$(space
),$(1))).ko
)
19 crypto_name
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(word 2,$(subst =,$(space
),$(1))))
21 # XXX: added CONFIG_CRYPTO_HMAC to KCONFIG so that CONFIG_CRYPTO_HASH is
22 # always set, even if no hash modules are selected
23 define KernelPackage
/crypto-core
24 SUBMENU
:=$(CRYPTO_MENU
)
25 TITLE
:=Core CryptoAPI modules
29 CONFIG_CRYPTO_ALGAPI \
30 $(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_confvar
,$(mod
)))
31 FILES
:=$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_file
,$(mod
)))
32 AUTOLOAD
:=$(call AutoLoad
,01,$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_name
,$(mod
))))
34 $(eval
$(call KernelPackage
,crypto-core
))
37 define AddDepends
/crypto
38 SUBMENU
:=$(CRYPTO_MENU
)
39 DEPENDS
+=kmod-crypto-core
$(1)
42 define KernelPackage
/crypto-hash
43 TITLE
:=CryptoAPI hash support
44 KCONFIG
:=CONFIG_CRYPTO_HASH2
45 FILES
:=$(LINUX_DIR
)/crypto
/crypto_hash.ko
46 AUTOLOAD
:=$(call AutoLoad
,02,crypto_hash
)
47 $(call AddDepends
/crypto
)
49 $(eval
$(call KernelPackage
,crypto-hash
))
51 define KernelPackage
/crypto-manager
52 TITLE
:=CryptoAPI algorithm manager
53 DEPENDS
:=+kmod-crypto-hash
56 CONFIG_CRYPTO_BLKCIPHER \
57 CONFIG_CRYPTO_MANAGER \
58 $(foreach mod
,$(CRYPTOMGR_MODULES
),$(call crypto_confvar
,$(mod
)))
59 FILES
:=$(foreach mod
,$(CRYPTOMGR_MODULES
),$(call crypto_file
,$(mod
)))
60 AUTOLOAD
:=$(call AutoLoad
,03,$(foreach mod
,$(CRYPTOMGR_MODULES
),$(call crypto_name
,$(mod
))))
61 $(call AddDepends
/crypto
)
63 $(eval
$(call KernelPackage
,crypto-manager
))
65 define KernelPackage
/crypto-user
66 TITLE
:=CryptoAPI userspace interface
67 DEPENDS
:=+kmod-crypto-hash
+kmod-crypto-manager @
!LINUX_2_6_30
&&!LINUX_2_6_31
&&!LINUX_2_6_32
&&!LINUX_2_6_36
&&!LINUX_2_6_37
69 CONFIG_CRYPTO_USER_API \
70 CONFIG_CRYPTO_USER_API_HASH \
71 CONFIG_CRYPTO_USER_API_SKCIPHER
73 $(LINUX_DIR
)/crypto
/af_alg.ko \
74 $(LINUX_DIR
)/crypto
/algif_hash.ko \
75 $(LINUX_DIR
)/crypto
/algif_skcipher.ko
76 AUTOLOAD
:=$(call AutoLoad
,09,af_alg algif_hash algif_skcipher
)
77 $(call AddDepends
/crypto
)
79 $(eval
$(call KernelPackage
,crypto-user
))
81 define KernelPackage
/crypto-wq
82 TITLE
:=CryptoAPI work queue handling
83 KCONFIG
:=CONFIG_CRYPTO_WORKQUEUE
84 FILES
:=$(LINUX_DIR
)/crypto
/crypto_wq.ko
85 AUTOLOAD
:=$(call AutoLoad
,09,crypto_wq
)
86 $(call AddDepends
/crypto
)
88 $(eval
$(call KernelPackage
,crypto-wq
))
90 define KernelPackage
/crypto-rng
91 TITLE
:=CryptoAPI random number generation
92 KCONFIG
:=CONFIG_CRYPTO_RNG2
94 $(LINUX_DIR
)/crypto
/rng.ko \
95 $(LINUX_DIR
)/crypto
/krng.ko
96 AUTOLOAD
:=$(call AutoLoad
,09,rng krng
)
97 $(call AddDepends
/crypto
)
99 $(eval
$(call KernelPackage
,crypto-rng
))
101 define KernelPackage
/crypto-iv
102 TITLE
:=CryptoAPI initialization vectors
103 DEPENDS
:=+kmod-crypto-manager
+kmod-crypto-rng
+kmod-crypto-wq
104 KCONFIG
:= CONFIG_CRYPTO_BLKCIPHER2
106 $(LINUX_DIR
)/crypto
/eseqiv.ko \
107 $(LINUX_DIR
)/crypto
/chainiv.ko
108 AUTOLOAD
:=$(call AutoLoad
,10,eseqiv chainiv
)
109 $(call AddDepends
/crypto
)
111 $(eval
$(call KernelPackage
,crypto-iv
))
113 define KernelPackage
/crypto-hw-padlock
114 TITLE
:=VIA PadLock ACE with AES
/SHA hw crypto module
115 DEPENDS
:=+kmod-crypto-aes
117 CONFIG_CRYPTO_DEV_PADLOCK \
118 CONFIG_CRYPTO_DEV_PADLOCK_AES \
119 CONFIG_CRYPTO_DEV_PADLOCK_SHA
121 $(LINUX_DIR
)/drivers
/crypto
/padlock-aes.ko \
122 $(LINUX_DIR
)/drivers
/crypto
/padlock-sha.ko
123 AUTOLOAD
:=$(call AutoLoad
,09,padlock-aes padlock-sha
)
124 $(call AddDepends
/crypto
)
127 $(eval
$(call KernelPackage
,crypto-hw-padlock
))
130 define KernelPackage
/crypto-hw-geode
131 TITLE
:=AMD Geode hardware crypto module
133 CONFIG_CRYPTO_DEV_GEODE
134 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/geode-aes.ko
135 AUTOLOAD
:=$(call AutoLoad
,09,geode-aes
)
136 $(call AddDepends
/crypto
)
139 $(eval
$(call KernelPackage
,crypto-hw-geode
))
142 define KernelPackage
/crypto-hw-hifn-795x
143 TITLE
:=HIFN
795x crypto accelerator
144 DEPENDS
:=@
!TARGET_ubicom32
147 CONFIG_CRYPTO_DEV_HIFN_795X \
148 CONFIG_CRYPTO_DEV_HIFN_795X_RNG
=y
149 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/hifn_795x.ko
150 AUTOLOAD
:=$(call AutoLoad
,09,hifn_795x
)
151 $(call AddDepends
/crypto
,+kmod-crypto-des
)
154 $(eval
$(call KernelPackage
,crypto-hw-hifn-795x
))
157 define KernelPackage
/crypto-hw-ixp4xx
158 TITLE
:=Intel IXP4xx hardware crypto module
159 DEPENDS
:=@TARGET_ixp4xx
161 CONFIG_CRYPTO_DEV_IXP4XX
162 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/ixp4xx_crypto.ko
163 AUTOLOAD
:=$(call AutoLoad
,90,ixp4xx_crypto
)
164 $(call AddDepends
/crypto
,+kmod-crypto-authenc
+kmod-crypto-des
)
167 define KernelPackage
/crypto-hw-ixp4xx
/description
168 Kernel support for the Intel IXP4xx HW crypto engine.
171 $(eval
$(call KernelPackage
,crypto-hw-ixp4xx
))
174 define KernelPackage
/crypto-hw-ppc4xx
175 TITLE
:=AMCC PPC4xx hardware crypto module
176 DEPENDS
:=@TARGET_ppc40x||TARGET_ppc44x
178 CONFIG_CRYPTO_DEV_PPC4XX
179 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/amcc
/crypto4xx.ko
180 AUTOLOAD
:=$(call AutoLoad
,90,crypto4xx
)
181 $(call AddDepends
/crypto
)
184 define KernelPackage
/crypto-hw-ppc4xx
/description
185 Kernel support for the AMCC PPC4xx HW crypto engine.
188 $(eval
$(call KernelPackage
,crypto-hw-ppc4xx
))
191 define KernelPackage
/crypto-aes
192 TITLE
:=AES cipher CryptoAPI module
193 KCONFIG
:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
194 FILES
:=$(LINUX_DIR
)/crypto
/aes_generic.ko
195 AUTOLOAD
:=$(call AutoLoad
,09,aes_generic
)
196 $(call AddDepends
/crypto
)
199 define KernelPackage
/crypto-aes
/x86
200 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/aes-i586.ko
201 AUTOLOAD
:=$(call AutoLoad
,09,aes_generic aes-i586
)
204 $(eval
$(call KernelPackage
,crypto-aes
))
207 define KernelPackage
/crypto-arc4
208 TITLE
:=ARC4
(RC4
) cipher CryptoAPI module
209 KCONFIG
:=CONFIG_CRYPTO_ARC4
210 FILES
:=$(LINUX_DIR
)/crypto
/arc4.ko
211 AUTOLOAD
:=$(call AutoLoad
,09,arc4
)
212 $(call AddDepends
/crypto
)
215 $(eval
$(call KernelPackage
,crypto-arc4
))
218 define KernelPackage
/crypto-authenc
219 TITLE
:=Combined mode wrapper for IPsec
220 DEPENDS
:=+kmod-crypto-manager
221 KCONFIG
:=CONFIG_CRYPTO_AUTHENC
222 FILES
:=$(LINUX_DIR
)/crypto
/authenc.ko
223 AUTOLOAD
:=$(call AutoLoad
,09,authenc
)
224 $(call AddDepends
/crypto
)
227 $(eval
$(call KernelPackage
,crypto-authenc
))
229 define KernelPackage
/crypto-cbc
230 TITLE
:=Cipher Block Chaining CryptoAPI module
231 DEPENDS
:=+kmod-crypto-manager
232 KCONFIG
:=CONFIG_CRYPTO_CBC
233 FILES
:=$(LINUX_DIR
)/crypto
/cbc.ko
234 AUTOLOAD
:=$(call AutoLoad
,09,cbc
)
235 $(call AddDepends
/crypto
)
238 $(eval
$(call KernelPackage
,crypto-cbc
))
240 define KernelPackage
/crypto-crc32c
241 TITLE
:=CRC32c CRC module
242 DEPENDS
:=+kmod-crypto-hash
243 KCONFIG
:=CONFIG_CRYPTO_CRC32C
244 FILES
:=$(LINUX_DIR
)/crypto
/crc32c.ko
245 AUTOLOAD
:=$(call AutoLoad
,04,crc32c
,1)
246 $(call AddDepends
/crypto
)
249 $(eval
$(call KernelPackage
,crypto-crc32c
))
251 define KernelPackage
/crypto-des
252 TITLE
:=DES
/3DES cipher CryptoAPI module
253 KCONFIG
:=CONFIG_CRYPTO_DES
254 FILES
:=$(LINUX_DIR
)/crypto
/des_generic.ko
255 AUTOLOAD
:=$(call AutoLoad
,09,des_generic
)
256 $(call AddDepends
/crypto
)
259 $(eval
$(call KernelPackage
,crypto-des
))
261 define KernelPackage
/crypto-deflate
262 TITLE
:=Deflate compression CryptoAPI module
263 DEPENDS
:=+kmod-lib-zlib
264 KCONFIG
:=CONFIG_CRYPTO_DEFLATE
265 FILES
:=$(LINUX_DIR
)/crypto
/deflate.ko
266 AUTOLOAD
:=$(call AutoLoad
,09,deflate
)
267 $(call AddDepends
/crypto
)
270 $(eval
$(call KernelPackage
,crypto-deflate
))
272 define KernelPackage
/crypto-ecb
273 TITLE
:=Electronic CodeBook CryptoAPI module
274 DEPENDS
:=+kmod-crypto-manager
275 KCONFIG
:=CONFIG_CRYPTO_ECB
276 FILES
:=$(LINUX_DIR
)/crypto
/ecb.ko
277 AUTOLOAD
:=$(call AutoLoad
,09,ecb
)
278 $(call AddDepends
/crypto
)
281 $(eval
$(call KernelPackage
,crypto-ecb
))
284 define KernelPackage
/crypto-hmac
285 TITLE
:=HMAC digest CryptoAPI module
286 DEPENDS
:=+kmod-crypto-hash
287 KCONFIG
:=CONFIG_CRYPTO_HMAC
288 FILES
:=$(LINUX_DIR
)/crypto
/hmac.ko
289 DEPENDS
:=+kmod-crypto-manager
290 AUTOLOAD
:=$(call AutoLoad
,09,hmac
)
291 $(call AddDepends
/crypto
)
294 $(eval
$(call KernelPackage
,crypto-hmac
))
297 define KernelPackage
/crypto-md4
298 TITLE
:=MD4 digest CryptoAPI module
299 DEPENDS
:=+kmod-crypto-hash
300 KCONFIG
:=CONFIG_CRYPTO_MD4
301 FILES
:=$(LINUX_DIR
)/crypto
/md4.ko
302 AUTOLOAD
:=$(call AutoLoad
,09,md4
)
303 $(call AddDepends
/crypto
)
306 $(eval
$(call KernelPackage
,crypto-md4
))
309 define KernelPackage
/crypto-md5
310 TITLE
:=MD5 digest CryptoAPI module
311 DEPENDS
:=+kmod-crypto-hash
312 KCONFIG
:=CONFIG_CRYPTO_MD5
313 FILES
:=$(LINUX_DIR
)/crypto
/md5.ko
314 AUTOLOAD
:=$(call AutoLoad
,09,md5
)
315 $(call AddDepends
/crypto
)
318 $(eval
$(call KernelPackage
,crypto-md5
))
321 define KernelPackage
/crypto-michael-mic
322 TITLE
:=Michael MIC keyed digest CryptoAPI module
323 DEPENDS
:=+kmod-crypto-hash
324 KCONFIG
:=CONFIG_CRYPTO_MICHAEL_MIC
325 FILES
:=$(LINUX_DIR
)/crypto
/michael_mic.ko
326 AUTOLOAD
:=$(call AutoLoad
,09,michael_mic
)
327 $(call AddDepends
/crypto
)
330 $(eval
$(call KernelPackage
,crypto-michael-mic
))
333 define KernelPackage
/crypto-sha1
334 TITLE
:=SHA1 digest CryptoAPI module
335 DEPENDS
:=+kmod-crypto-hash
336 KCONFIG
:=CONFIG_CRYPTO_SHA1
337 FILES
:=$(LINUX_DIR
)/crypto
/sha1_generic.ko
338 AUTOLOAD
:=$(call AutoLoad
,09,sha1_generic
)
339 $(call AddDepends
/crypto
)
342 $(eval
$(call KernelPackage
,crypto-sha1
))
345 define KernelPackage
/crypto-misc
346 TITLE
:=Other CryptoAPI modules
347 DEPENDS
:=+kmod-crypto-manager
349 CONFIG_CRYPTO_ANUBIS \
350 CONFIG_CRYPTO_BLOWFISH \
351 CONFIG_CRYPTO_CAMELLIA \
352 CONFIG_CRYPTO_CAST5 \
353 CONFIG_CRYPTO_CAST6 \
354 CONFIG_CRYPTO_FCRYPT \
355 CONFIG_CRYPTO_KHAZAD \
356 CONFIG_CRYPTO_SERPENT \
357 CONFIG_CRYPTO_SHA256 \
358 CONFIG_CRYPTO_SHA512 \
360 CONFIG_CRYPTO_TGR192 \
361 CONFIG_CRYPTO_TWOFISH \
362 CONFIG_CRYPTO_TWOFISH_COMMON \
363 CONFIG_CRYPTO_TWOFISH_586 \
366 $(LINUX_DIR
)/crypto
/anubis.ko \
367 $(LINUX_DIR
)/crypto
/camellia.ko \
368 $(LINUX_DIR
)/crypto
/cast5.ko \
369 $(LINUX_DIR
)/crypto
/cast6.ko \
370 $(LINUX_DIR
)/crypto
/fcrypt.ko \
371 $(LINUX_DIR
)/crypto
/khazad.ko \
372 $(LINUX_DIR
)/crypto
/sha256_generic.ko \
373 $(LINUX_DIR
)/crypto
/sha512_generic.ko \
374 $(LINUX_DIR
)/crypto
/tea.ko \
375 $(LINUX_DIR
)/crypto
/tgr192.ko \
376 $(LINUX_DIR
)/crypto
/twofish_common.ko \
377 $(LINUX_DIR
)/crypto
/wp512.ko
378 ifeq ($(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),le
,2.6.35)),1)
379 FILES
+= $(LINUX_DIR
)/crypto
/twofish.ko
381 FILES
+= $(LINUX_DIR
)/crypto
/twofish_generic.ko
383 ifeq ($(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),le
,3.1)),1)
384 FILES
+= $(LINUX_DIR
)/crypto
/blowfish.ko
387 $(LINUX_DIR
)/crypto
/blowfish_common.ko \
388 $(LINUX_DIR
)/crypto
/blowfish_generic.ko
390 ifeq ($(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),le
,3.2)),1)
391 FILES
+= $(LINUX_DIR
)/crypto
/serpent.ko
393 FILES
+= $(LINUX_DIR
)/crypto
/serpent_generic.ko
395 $(call AddDepends
/crypto
)
399 define KernelPackage
/crypto-misc
/x86
400 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/twofish-i586.ko
403 $(eval
$(call KernelPackage
,crypto-misc
))
406 define KernelPackage
/crypto-ocf
408 DEPENDS
:=+@OPENSSL_ENGINE @
!TARGET_uml
+kmod-crypto-manager
411 CONFIG_OCF_CRYPTODEV \
412 CONFIG_OCF_CRYPTOSOFT \
414 CONFIG_OCF_RANDOMHARVEST
=y
416 $(LINUX_DIR
)/crypto
/ocf
/ocf.ko \
417 $(LINUX_DIR
)/crypto
/ocf
/cryptodev.ko \
418 $(LINUX_DIR
)/crypto
/ocf
/cryptosoft.ko
419 AUTOLOAD
:=$(call AutoLoad
,09, \
424 $(call AddDepends
/crypto
)
427 $(eval
$(call KernelPackage
,crypto-ocf
))
430 define KernelPackage
/crypto-ocf-hifn7751
431 TITLE
:=OCF support for Hifn
6500/7751/7811/795x
, Invertex AEON and NetSec
7751 devices
432 DEPENDS
:=+@OPENSSL_ENGINE @PCI_SUPPORT @
!TARGET_uml kmod-crypto-ocf
433 KCONFIG
:=CONFIG_OCF_HIFN
434 FILES
:=$(LINUX_DIR
)/crypto
/ocf
/hifn
/hifn7751.ko
435 AUTOLOAD
:=$(call AutoLoad
,10,hifn7751
)
436 $(call AddDepends
/crypto
)
439 $(eval
$(call KernelPackage
,crypto-ocf-hifn7751
))
442 define KernelPackage
/crypto-ocf-hifnhipp
443 TITLE
:=OCF support for Hifn
7855/8155 devices
444 DEPENDS
:=+@OPENSSL_ENGINE @PCI_SUPPORT @
!TARGET_uml kmod-crypto-ocf
445 KCONFIG
:=CONFIG_OCF_HIFNHIPP
446 FILES
:=$(LINUX_DIR
)/crypto
/ocf
/hifn
/hifnHIPP.ko
447 AUTOLOAD
:=$(call AutoLoad
,10,hifnHIPP
)
448 $(call AddDepends
/crypto
)
451 $(eval
$(call KernelPackage
,crypto-ocf-hifnhipp
))
454 define KernelPackage
/crypto-null
455 TITLE
:=Null CryptoAPI module
456 KCONFIG
:=CONFIG_CRYPTO_NULL
457 FILES
:=$(LINUX_DIR
)/crypto
/crypto_null.ko
458 AUTOLOAD
:=$(call AutoLoad
,09,crypto_null
)
459 $(call AddDepends
/crypto
)
462 $(eval
$(call KernelPackage
,crypto-null
))
465 define KernelPackage
/crypto-test
466 TITLE
:=Test CryptoAPI module
467 KCONFIG
:=CONFIG_CRYPTO_TEST
468 FILES
:=$(LINUX_DIR
)/crypto
/tcrypt.ko
469 $(call AddDepends
/crypto
)
472 $(eval
$(call KernelPackage
,crypto-test
))
475 define KernelPackage
/crypto-xts
476 TITLE
:=XTS cipher CryptoAPI module
477 DEPENDS
:=+kmod-crypto-manager
479 CONFIG_CRYPTO_GF128MUL \
482 $(LINUX_DIR
)/crypto
/xts.ko \
483 $(LINUX_DIR
)/crypto
/gf128mul.ko
484 AUTOLOAD
:=$(call AutoLoad
,09, \
488 $(call AddDepends
/crypto
)
491 $(eval
$(call KernelPackage
,crypto-xts
))
493 define KernelPackage
/crypto-mv-cesa
494 TITLE
:=Marvell crypto engine
495 DEPENDS
:=+kmod-crypto-manager
+kmod-crypto-aes @TARGET_kirkwood||TARGET_orion
496 KCONFIG
:=CONFIG_CRYPTO_DEV_MV_CESA
497 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/mv_cesa.ko
498 AUTOLOAD
:=$(call AutoLoad
,09,mv_cesa
)
499 $(call AddDepends
/crypto
)
502 $(eval
$(call KernelPackage
,crypto-mv-cesa
))
505 define KernelPackage
/ocf-ubsec-ssb
506 TITLE
:=BCM5365P IPSec Core driver
507 DEPENDS
:=@TARGET_brcm47xx
+kmod-crypto-ocf
508 KCONFIG
:=CONFIG_OCF_UBSEC_SSB
509 FILES
:=$(LINUX_DIR
)/crypto
/ocf
/ubsec_ssb
/ubsec_ssb.ko
510 AUTOLOAD
:=$(call AutoLoad
,10,ubsec_ssb
)
511 $(call AddDepends
/crypto
)
514 define KernelPackage
/ocf-ubsec-ssb
/description
515 This package contains the OCF driver for the BCM5365p IPSec Core
518 $(eval
$(call KernelPackage
,ocf-ubsec-ssb
))