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-wq
66 TITLE
:=CryptoAPI work queue handling
67 KCONFIG
:=CONFIG_CRYPTO_WORKQUEUE
68 FILES
:=$(LINUX_DIR
)/crypto
/crypto_wq.ko
69 AUTOLOAD
:=$(call AutoLoad
,09,crypto_wq
)
70 $(call AddDepends
/crypto
)
72 $(eval
$(call KernelPackage
,crypto-wq
))
74 define KernelPackage
/crypto-rng
75 TITLE
:=CryptoAPI random number generation
76 KCONFIG
:=CONFIG_CRYPTO_RNG2
78 $(LINUX_DIR
)/crypto
/rng.ko \
79 $(LINUX_DIR
)/crypto
/krng.ko
80 AUTOLOAD
:=$(call AutoLoad
,09,rng krng
)
81 $(call AddDepends
/crypto
)
83 $(eval
$(call KernelPackage
,crypto-rng
))
85 define KernelPackage
/crypto-iv
86 TITLE
:=CryptoAPI initialization vectors
87 DEPENDS
:=+kmod-crypto-manager
+kmod-crypto-rng
+kmod-crypto-wq
88 KCONFIG
:= CONFIG_CRYPTO_BLKCIPHER2
90 $(LINUX_DIR
)/crypto
/eseqiv.ko \
91 $(LINUX_DIR
)/crypto
/chainiv.ko
92 AUTOLOAD
:=$(call AutoLoad
,10,eseqiv chainiv
)
93 $(call AddDepends
/crypto
)
95 $(eval
$(call KernelPackage
,crypto-iv
))
97 define KernelPackage
/crypto-hw-padlock
98 TITLE
:=VIA PadLock ACE with AES
/SHA hw crypto module
99 DEPENDS
:=+kmod-crypto-aes
101 CONFIG_CRYPTO_DEV_PADLOCK \
102 CONFIG_CRYPTO_DEV_PADLOCK_AES \
103 CONFIG_CRYPTO_DEV_PADLOCK_SHA
105 $(LINUX_DIR
)/drivers
/crypto
/padlock-aes.ko \
106 $(LINUX_DIR
)/drivers
/crypto
/padlock-sha.ko
107 AUTOLOAD
:=$(call AutoLoad
,09,padlock-aes padlock-sha
)
108 $(call AddDepends
/crypto
)
111 $(eval
$(call KernelPackage
,crypto-hw-padlock
))
114 define KernelPackage
/crypto-hw-geode
115 TITLE
:=AMD Geode hardware crypto module
117 CONFIG_CRYPTO_DEV_GEODE
118 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/geode-aes.ko
119 AUTOLOAD
:=$(call AutoLoad
,09,geode-aes
)
120 $(call AddDepends
/crypto
)
123 $(eval
$(call KernelPackage
,crypto-hw-geode
))
126 define KernelPackage
/crypto-hw-hifn-795x
127 TITLE
:=HIFN
795x crypto accelerator
128 DEPENDS
:=@
!TARGET_ubicom32
131 CONFIG_CRYPTO_DEV_HIFN_795X \
132 CONFIG_CRYPTO_DEV_HIFN_795X_RNG
=y
133 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/hifn_795x.ko
134 AUTOLOAD
:=$(call AutoLoad
,09,hifn_795x
)
135 $(call AddDepends
/crypto
,+kmod-crypto-des
)
138 $(eval
$(call KernelPackage
,crypto-hw-hifn-795x
))
141 define KernelPackage
/crypto-hw-ixp4xx
142 TITLE
:=Intel IXP4xx hardware crypto module
143 DEPENDS
:=@TARGET_ixp4xx
145 CONFIG_CRYPTO_DEV_IXP4XX
146 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/ixp4xx_crypto.ko
147 AUTOLOAD
:=$(call AutoLoad
,90,ixp4xx_crypto
)
148 $(call AddDepends
/crypto
,+kmod-crypto-authenc
+kmod-crypto-des
)
151 define KernelPackage
/crypto-hw-ixp4xx
/description
152 Kernel support for the Intel IXP4xx HW crypto engine.
155 $(eval
$(call KernelPackage
,crypto-hw-ixp4xx
))
158 define KernelPackage
/crypto-hw-ppc4xx
159 TITLE
:=AMCC PPC4xx hardware crypto module
160 DEPENDS
:=@TARGET_ppc40x||TARGET_ppc44x
162 CONFIG_CRYPTO_DEV_PPC4XX
163 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/amcc
/crypto4xx.ko
164 AUTOLOAD
:=$(call AutoLoad
,90,crypto4xx
)
165 $(call AddDepends
/crypto
)
168 define KernelPackage
/crypto-hw-ppc4xx
/description
169 Kernel support for the AMCC PPC4xx HW crypto engine.
172 $(eval
$(call KernelPackage
,crypto-hw-ppc4xx
))
175 define KernelPackage
/crypto-aes
176 TITLE
:=AES cipher CryptoAPI module
177 KCONFIG
:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
178 FILES
:=$(LINUX_DIR
)/crypto
/aes_generic.ko
179 AUTOLOAD
:=$(call AutoLoad
,09,aes_generic
)
180 $(call AddDepends
/crypto
)
183 define KernelPackage
/crypto-aes
/x86
184 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/aes-i586.ko
185 AUTOLOAD
:=$(call AutoLoad
,09,aes_generic aes-i586
)
188 $(eval
$(call KernelPackage
,crypto-aes
))
191 define KernelPackage
/crypto-arc4
192 TITLE
:=ARC4
(RC4
) cipher CryptoAPI module
193 KCONFIG
:=CONFIG_CRYPTO_ARC4
194 FILES
:=$(LINUX_DIR
)/crypto
/arc4.ko
195 AUTOLOAD
:=$(call AutoLoad
,09,arc4
)
196 $(call AddDepends
/crypto
)
199 $(eval
$(call KernelPackage
,crypto-arc4
))
202 define KernelPackage
/crypto-authenc
203 TITLE
:=Combined mode wrapper for IPsec
204 DEPENDS
:=+kmod-crypto-manager
205 KCONFIG
:=CONFIG_CRYPTO_AUTHENC
206 FILES
:=$(LINUX_DIR
)/crypto
/authenc.ko
207 AUTOLOAD
:=$(call AutoLoad
,09,authenc
)
208 $(call AddDepends
/crypto
)
211 $(eval
$(call KernelPackage
,crypto-authenc
))
213 define KernelPackage
/crypto-cbc
214 TITLE
:=Cipher Block Chaining CryptoAPI module
215 DEPENDS
:=+kmod-crypto-manager
216 KCONFIG
:=CONFIG_CRYPTO_CBC
217 FILES
:=$(LINUX_DIR
)/crypto
/cbc.ko
218 AUTOLOAD
:=$(call AutoLoad
,09,cbc
)
219 $(call AddDepends
/crypto
)
222 $(eval
$(call KernelPackage
,crypto-cbc
))
224 define KernelPackage
/crypto-des
225 TITLE
:=DES
/3DES cipher CryptoAPI module
226 KCONFIG
:=CONFIG_CRYPTO_DES
227 FILES
:=$(LINUX_DIR
)/crypto
/des_generic.ko
228 AUTOLOAD
:=$(call AutoLoad
,09,des_generic
)
229 $(call AddDepends
/crypto
)
232 $(eval
$(call KernelPackage
,crypto-des
))
234 define KernelPackage
/crypto-deflate
235 TITLE
:=Deflate compression CryptoAPI module
237 KCONFIG
:=CONFIG_CRYPTO_DEFLATE
238 FILES
:=$(LINUX_DIR
)/crypto
/deflate.ko
239 AUTOLOAD
:=$(call AutoLoad
,09,deflate
)
240 $(call AddDepends
/crypto
)
243 $(eval
$(call KernelPackage
,crypto-deflate
))
245 define KernelPackage
/crypto-ecb
246 TITLE
:=Electronic CodeBook CryptoAPI module
247 DEPENDS
:=+kmod-crypto-manager
248 KCONFIG
:=CONFIG_CRYPTO_ECB
249 FILES
:=$(LINUX_DIR
)/crypto
/ecb.ko
250 AUTOLOAD
:=$(call AutoLoad
,09,ecb
)
251 $(call AddDepends
/crypto
)
254 $(eval
$(call KernelPackage
,crypto-ecb
))
257 define KernelPackage
/crypto-hmac
258 TITLE
:=HMAC digest CryptoAPI module
259 DEPENDS
:=+kmod-crypto-hash
260 KCONFIG
:=CONFIG_CRYPTO_HMAC
261 FILES
:=$(LINUX_DIR
)/crypto
/hmac.ko
262 DEPENDS
:=+kmod-crypto-manager
263 AUTOLOAD
:=$(call AutoLoad
,09,hmac
)
264 $(call AddDepends
/crypto
)
267 $(eval
$(call KernelPackage
,crypto-hmac
))
270 define KernelPackage
/crypto-md5
271 TITLE
:=MD5 digest CryptoAPI module
272 DEPENDS
:=+kmod-crypto-hash
273 KCONFIG
:=CONFIG_CRYPTO_MD5
274 FILES
:=$(LINUX_DIR
)/crypto
/md5.ko
275 AUTOLOAD
:=$(call AutoLoad
,09,md5
)
276 $(call AddDepends
/crypto
)
279 $(eval
$(call KernelPackage
,crypto-md5
))
282 define KernelPackage
/crypto-michael-mic
283 TITLE
:=Michael MIC keyed digest CryptoAPI module
284 DEPENDS
:=+kmod-crypto-hash
285 KCONFIG
:=CONFIG_CRYPTO_MICHAEL_MIC
286 FILES
:=$(LINUX_DIR
)/crypto
/michael_mic.ko
287 AUTOLOAD
:=$(call AutoLoad
,09,michael_mic
)
288 $(call AddDepends
/crypto
)
291 $(eval
$(call KernelPackage
,crypto-michael-mic
))
294 define KernelPackage
/crypto-sha1
295 TITLE
:=SHA1 digest CryptoAPI module
296 DEPENDS
:=+kmod-crypto-hash
297 KCONFIG
:=CONFIG_CRYPTO_SHA1
298 FILES
:=$(LINUX_DIR
)/crypto
/sha1_generic.ko
299 AUTOLOAD
:=$(call AutoLoad
,09,sha1_generic
)
300 $(call AddDepends
/crypto
)
303 $(eval
$(call KernelPackage
,crypto-sha1
))
306 define KernelPackage
/crypto-misc
307 TITLE
:=Other CryptoAPI modules
308 DEPENDS
:=+kmod-crypto-manager
310 CONFIG_CRYPTO_ANUBIS \
311 CONFIG_CRYPTO_BLOWFISH \
312 CONFIG_CRYPTO_CAMELLIA \
313 CONFIG_CRYPTO_CAST5 \
314 CONFIG_CRYPTO_CAST6 \
315 CONFIG_CRYPTO_CRC32C \
316 CONFIG_CRYPTO_FCRYPT \
317 CONFIG_CRYPTO_KHAZAD \
319 CONFIG_CRYPTO_SERPENT \
320 CONFIG_CRYPTO_SHA256 \
321 CONFIG_CRYPTO_SHA512 \
323 CONFIG_CRYPTO_TGR192 \
324 CONFIG_CRYPTO_TWOFISH \
325 CONFIG_CRYPTO_TWOFISH_COMMON \
326 CONFIG_CRYPTO_TWOFISH_586 \
329 $(LINUX_DIR
)/crypto
/anubis.ko \
330 $(LINUX_DIR
)/crypto
/blowfish.ko \
331 $(LINUX_DIR
)/crypto
/camellia.ko \
332 $(LINUX_DIR
)/crypto
/cast5.ko \
333 $(LINUX_DIR
)/crypto
/cast6.ko \
334 $(if
$(findstring y
,$(CONFIG_CRYPTO_CRC32C
)),,$(LINUX_DIR
)/crypto
/crc32c.ko
) \
335 $(LINUX_DIR
)/crypto
/fcrypt.ko \
336 $(LINUX_DIR
)/crypto
/khazad.ko \
337 $(LINUX_DIR
)/crypto
/md4.ko \
338 $(LINUX_DIR
)/crypto
/serpent.ko \
339 $(LINUX_DIR
)/crypto
/sha256_generic.ko \
340 $(LINUX_DIR
)/crypto
/sha512_generic.ko \
341 $(LINUX_DIR
)/crypto
/tea.ko \
342 $(LINUX_DIR
)/crypto
/tgr192.ko \
343 $(LINUX_DIR
)/crypto
/twofish_common.ko \
344 $(LINUX_DIR
)/crypto
/wp512.ko
345 ifeq ($(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),le
,2.6.35)),1)
346 FILES
+= $(LINUX_DIR
)/crypto
/twofish.ko
348 FILES
+= $(LINUX_DIR
)/crypto
/twofish_generic.ko
350 $(call AddDepends
/crypto
)
354 define KernelPackage
/crypto-misc
/x86
355 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/twofish-i586.ko
358 $(eval
$(call KernelPackage
,crypto-misc
))
361 define KernelPackage
/crypto-ocf
363 DEPENDS
:=+@OPENSSL_ENGINE @
!TARGET_uml
+kmod-crypto-manager
366 CONFIG_OCF_CRYPTODEV \
367 CONFIG_OCF_CRYPTOSOFT \
369 CONFIG_OCF_RANDOMHARVEST
=y
371 $(LINUX_DIR
)/crypto
/ocf
/ocf.ko \
372 $(LINUX_DIR
)/crypto
/ocf
/cryptodev.ko \
373 $(LINUX_DIR
)/crypto
/ocf
/cryptosoft.ko
374 AUTOLOAD
:=$(call AutoLoad
,09, \
379 $(call AddDepends
/crypto
)
382 $(eval
$(call KernelPackage
,crypto-ocf
))
385 define KernelPackage
/crypto-ocf-hifn7751
386 TITLE
:=OCF support for Hifn
6500/7751/7811/795x
, Invertex AEON and NetSec
7751 devices
387 DEPENDS
:=+@OPENSSL_ENGINE @PCI_SUPPORT @
!TARGET_uml kmod-crypto-ocf
388 KCONFIG
:=CONFIG_OCF_HIFN
389 FILES
:=$(LINUX_DIR
)/crypto
/ocf
/hifn
/hifn7751.ko
390 AUTOLOAD
:=$(call AutoLoad
,10,hifn7751
)
391 $(call AddDepends
/crypto
)
394 $(eval
$(call KernelPackage
,crypto-ocf-hifn7751
))
397 define KernelPackage
/crypto-ocf-hifnhipp
398 TITLE
:=OCF support for Hifn
7855/8155 devices
399 DEPENDS
:=+@OPENSSL_ENGINE @PCI_SUPPORT @
!TARGET_uml kmod-crypto-ocf
400 KCONFIG
:=CONFIG_OCF_HIFNHIPP
401 FILES
:=$(LINUX_DIR
)/crypto
/ocf
/hifn
/hifnHIPP.ko
402 AUTOLOAD
:=$(call AutoLoad
,10,hifnhipp
)
403 $(call AddDepends
/crypto
)
406 $(eval
$(call KernelPackage
,crypto-ocf-hifnhipp
))
409 define KernelPackage
/crypto-null
410 TITLE
:=Null CryptoAPI module
411 KCONFIG
:=CONFIG_CRYPTO_NULL
412 FILES
:=$(LINUX_DIR
)/crypto
/crypto_null.ko
413 AUTOLOAD
:=$(call AutoLoad
,09,crypto_null
)
414 $(call AddDepends
/crypto
)
417 $(eval
$(call KernelPackage
,crypto-null
))
420 define KernelPackage
/crypto-test
421 TITLE
:=Test CryptoAPI module
422 KCONFIG
:=CONFIG_CRYPTO_TEST
423 FILES
:=$(LINUX_DIR
)/crypto
/tcrypt.ko
424 $(call AddDepends
/crypto
)
427 $(eval
$(call KernelPackage
,crypto-test
))
430 define KernelPackage
/crypto-xts
431 TITLE
:=XTS cipher CryptoAPI module
432 DEPENDS
:=+kmod-crypto-manager
434 CONFIG_CRYPTO_GF128MUL \
437 $(LINUX_DIR
)/crypto
/xts.ko \
438 $(LINUX_DIR
)/crypto
/gf128mul.ko
439 AUTOLOAD
:=$(call AutoLoad
,09, \
443 $(call AddDepends
/crypto
)
446 $(eval
$(call KernelPackage
,crypto-xts
))
448 define KernelPackage
/crypto-mv-cesa
449 TITLE
:=Marvell crypto engine
450 DEPENDS
:=+kmod-crypto-manager
+kmod-crypto-aes @TARGET_kirkwood||TARGET_orion
451 KCONFIG
:=CONFIG_CRYPTO_DEV_MV_CESA
452 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/mv_cesa.ko
453 AUTOLOAD
:=$(call AutoLoad
,09,mv_cesa
)
454 $(call AddDepends
/crypto
)
457 $(eval
$(call KernelPackage
,crypto-mv-cesa
))