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 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
219 KCONFIG
:=CONFIG_CRYPTO_DEFLATE
220 FILES
:=$(LINUX_DIR
)/crypto
/deflate.ko
221 AUTOLOAD
:=$(call AutoLoad
,09,deflate
)
222 $(call AddDepends
/crypto
)
225 $(eval
$(call KernelPackage
,crypto-deflate
))
227 define KernelPackage
/crypto-ecb
228 TITLE
:=Electronic CodeBook CryptoAPI module
229 DEPENDS
:=+kmod-crypto-manager
230 KCONFIG
:=CONFIG_CRYPTO_ECB
231 FILES
:=$(LINUX_DIR
)/crypto
/ecb.ko
232 AUTOLOAD
:=$(call AutoLoad
,09,ecb
)
233 $(call AddDepends
/crypto
)
236 $(eval
$(call KernelPackage
,crypto-ecb
))
239 define KernelPackage
/crypto-hmac
240 TITLE
:=HMAC digest CryptoAPI module
241 DEPENDS
:=+kmod-crypto-hash
242 KCONFIG
:=CONFIG_CRYPTO_HMAC
243 FILES
:=$(LINUX_DIR
)/crypto
/hmac.ko
244 DEPENDS
:=+kmod-crypto-manager
245 AUTOLOAD
:=$(call AutoLoad
,09,hmac
)
246 $(call AddDepends
/crypto
)
249 $(eval
$(call KernelPackage
,crypto-hmac
))
252 define KernelPackage
/crypto-md5
253 TITLE
:=MD5 digest CryptoAPI module
254 DEPENDS
:=+kmod-crypto-hash
255 KCONFIG
:=CONFIG_CRYPTO_MD5
256 FILES
:=$(LINUX_DIR
)/crypto
/md5.ko
257 AUTOLOAD
:=$(call AutoLoad
,09,md5
)
258 $(call AddDepends
/crypto
)
261 $(eval
$(call KernelPackage
,crypto-md5
))
264 define KernelPackage
/crypto-michael-mic
265 TITLE
:=Michael MIC keyed digest CryptoAPI module
266 DEPENDS
:=+kmod-crypto-hash
267 KCONFIG
:=CONFIG_CRYPTO_MICHAEL_MIC
268 FILES
:=$(LINUX_DIR
)/crypto
/michael_mic.ko
269 AUTOLOAD
:=$(call AutoLoad
,09,michael_mic
)
270 $(call AddDepends
/crypto
)
273 $(eval
$(call KernelPackage
,crypto-michael-mic
))
276 define KernelPackage
/crypto-sha1
277 TITLE
:=SHA1 digest CryptoAPI module
278 DEPENDS
:=+kmod-crypto-hash
279 KCONFIG
:=CONFIG_CRYPTO_SHA1
280 FILES
:=$(LINUX_DIR
)/crypto
/sha1
$(SHA1_SUFFIX
).ko
281 AUTOLOAD
:=$(call AutoLoad
,09,sha1
$(SHA1_SUFFIX
))
282 $(call AddDepends
/crypto
)
285 $(eval
$(call KernelPackage
,crypto-sha1
))
288 define KernelPackage
/crypto-misc
289 TITLE
:=Other CryptoAPI modules
290 DEPENDS
:=+kmod-crypto-manager
292 CONFIG_CRYPTO_ANUBIS \
293 CONFIG_CRYPTO_BLOWFISH \
294 CONFIG_CRYPTO_CAMELLIA \
295 CONFIG_CRYPTO_CAST5 \
296 CONFIG_CRYPTO_CAST6 \
297 CONFIG_CRYPTO_CRC32C \
298 CONFIG_CRYPTO_FCRYPT \
299 CONFIG_CRYPTO_KHAZAD \
301 CONFIG_CRYPTO_SERPENT \
302 CONFIG_CRYPTO_SHA256 \
303 CONFIG_CRYPTO_SHA512 \
305 CONFIG_CRYPTO_TGR192 \
306 CONFIG_CRYPTO_TWOFISH \
307 CONFIG_CRYPTO_TWOFISH_COMMON \
308 CONFIG_CRYPTO_TWOFISH_586 \
311 $(LINUX_DIR
)/crypto
/anubis.ko \
312 $(LINUX_DIR
)/crypto
/blowfish.ko \
313 $(LINUX_DIR
)/crypto
/cast5.ko \
314 $(LINUX_DIR
)/crypto
/cast6.ko \
315 $(LINUX_DIR
)/crypto
/khazad.ko \
316 $(LINUX_DIR
)/crypto
/md4.ko \
317 $(LINUX_DIR
)/crypto
/serpent.ko \
318 $(LINUX_DIR
)/crypto
/sha256
$(SHA256_SUFFIX
).ko \
319 $(LINUX_DIR
)/crypto
/sha512
$(SHA512_SUFFIX
).ko \
320 $(LINUX_DIR
)/crypto
/tea.ko \
321 $(LINUX_DIR
)/crypto
/wp512.ko
322 ifeq ($(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),le
,2.6.35)),1)
323 FILES
+= $(LINUX_DIR
)/crypto
/twofish.ko
325 FILES
+= $(LINUX_DIR
)/crypto
/twofish_generic.ko
327 $(call AddDepends
/crypto
)
330 define KernelPackage
/crypto-misc
/2.6
332 $(LINUX_DIR
)/crypto
/camellia.ko \
333 $(if
$(findstring y
,$(CONFIG_CRYPTO_CRC32C
)),,$(LINUX_DIR
)/crypto
/crc32c.ko
) \
334 $(LINUX_DIR
)/crypto
/fcrypt.ko \
335 $(LINUX_DIR
)/crypto
/tgr192.ko \
336 $(LINUX_DIR
)/crypto
/twofish_common.ko
339 define KernelPackage
/crypto-misc
/x86
340 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/twofish-i586.ko
343 $(eval
$(call KernelPackage
,crypto-misc
))
346 define KernelPackage
/crypto-ocf
348 DEPENDS
:=+@OPENSSL_ENGINE @
!TARGET_uml
+kmod-crypto-manager
351 CONFIG_OCF_CRYPTODEV \
352 CONFIG_OCF_CRYPTOSOFT \
354 CONFIG_OCF_RANDOMHARVEST
=y
356 $(LINUX_DIR
)/crypto
/ocf
/ocf.ko \
357 $(LINUX_DIR
)/crypto
/ocf
/cryptodev.ko \
358 $(LINUX_DIR
)/crypto
/ocf
/cryptosoft.ko
359 AUTOLOAD
:=$(call AutoLoad
,09, \
364 $(call AddDepends
/crypto
)
367 $(eval
$(call KernelPackage
,crypto-ocf
))
370 define KernelPackage
/crypto-ocf-hifn7751
371 TITLE
:=OCF support for Hifn
6500/7751/7811/795x
, Invertex AEON and NetSec
7751 devices
372 DEPENDS
:=+@OPENSSL_ENGINE @PCI_SUPPORT @
!TARGET_uml kmod-crypto-ocf
373 KCONFIG
:=CONFIG_OCF_HIFN
374 FILES
:=$(LINUX_DIR
)/crypto
/ocf
/hifn
/hifn7751.ko
375 AUTOLOAD
:=$(call AutoLoad
,10,hifn7751
)
376 $(call AddDepends
/crypto
)
379 $(eval
$(call KernelPackage
,crypto-ocf-hifn7751
))
382 define KernelPackage
/crypto-ocf-hifnhipp
383 TITLE
:=OCF support for Hifn
7855/8155 devices
384 DEPENDS
:=+@OPENSSL_ENGINE @PCI_SUPPORT @
!TARGET_uml kmod-crypto-ocf
385 KCONFIG
:=CONFIG_OCF_HIFNHIPP
386 FILES
:=$(LINUX_DIR
)/crypto
/ocf
/hifn
/hifnHIPP.ko
387 AUTOLOAD
:=$(call AutoLoad
,10,hifnhipp
)
388 $(call AddDepends
/crypto
)
391 $(eval
$(call KernelPackage
,crypto-ocf-hifnhipp
))
394 define KernelPackage
/crypto-null
395 TITLE
:=Null CryptoAPI module
396 KCONFIG
:=CONFIG_CRYPTO_NULL
397 FILES
:=$(LINUX_DIR
)/crypto
/crypto_null.ko
398 AUTOLOAD
:=$(call AutoLoad
,09,crypto_null
)
399 $(call AddDepends
/crypto
)
402 $(eval
$(call KernelPackage
,crypto-null
))
405 define KernelPackage
/crypto-test
406 TITLE
:=Test CryptoAPI module
407 KCONFIG
:=CONFIG_CRYPTO_TEST
408 FILES
:=$(LINUX_DIR
)/crypto
/tcrypt.ko
409 $(call AddDepends
/crypto
)
412 $(eval
$(call KernelPackage
,crypto-test
))
415 define KernelPackage
/crypto-xts
416 TITLE
:=XTS cipher CryptoAPI module
417 DEPENDS
:=+kmod-crypto-manager
419 CONFIG_CRYPTO_GF128MUL \
422 $(LINUX_DIR
)/crypto
/xts.ko \
423 $(LINUX_DIR
)/crypto
/gf128mul.ko
424 AUTOLOAD
:=$(call AutoLoad
,09, \
428 $(call AddDepends
/crypto
)
431 $(eval
$(call KernelPackage
,crypto-xts
))
433 define KernelPackage
/crypto-mv-cesa
434 TITLE
:=Marvell crypto engine
435 DEPENDS
:=+kmod-crypto-manager @TARGET_kirkwood||TARGET_orion
436 KCONFIG
:=CONFIG_CRYPTO_DEV_MV_CESA
437 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/mv_cesa.ko
438 AUTOLOAD
:=$(call AutoLoad
,09,mv_cesa
)
439 $(call AddDepends
/crypto
)
442 $(eval
$(call KernelPackage
,crypto-mv-cesa
))