2 # Copyright (C) 2006-2010 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
)
25 ALGAPI2
=crypto_algapi \
27 BLKCIPHER2
=crypto_blkcipher \
32 crypto_confvar
=CONFIG_CRYPTO_
$(word 1,$(subst =,$(space
),$(1)))
33 crypto_file
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(LINUX_DIR
)/crypto
/$(word 2,$(subst =,$(space
),$(1))).ko
)
34 crypto_name
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(word 2,$(subst =,$(space
),$(1))))
36 # XXX: added CONFIG_CRYPTO_HMAC to KCONFIG so that CONFIG_CRYPTO_HASH is
37 # always set, even if no hash modules are selected
38 define KernelPackage
/crypto-core
39 SUBMENU
:=$(CRYPTO_MENU
)
40 TITLE
:=Core CryptoAPI modules
46 CONFIG_CRYPTO_ALGAPI \
47 CONFIG_CRYPTO_BLKCIPHER \
49 CONFIG_CRYPTO_MANAGER \
50 $(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_confvar
,$(mod
)))
51 FILES
:=$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_file
,$(mod
)))
52 AUTOLOAD
:=$(call AutoLoad
,01,$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_name
,$(mod
))))
54 $(eval
$(call KernelPackage
,crypto-core
))
57 define AddDepends
/crypto
58 SUBMENU
:=$(CRYPTO_MENU
)
59 DEPENDS
+=kmod-crypto-core
$(1)
63 define KernelPackage
/crypto-hw-padlock
64 TITLE
:=VIA PadLock ACE with AES
/SHA hw crypto module
65 DEPENDS
:=+kmod-crypto-aes
67 CONFIG_CRYPTO_DEV_PADLOCK \
68 CONFIG_CRYPTO_DEV_PADLOCK_AES \
69 CONFIG_CRYPTO_DEV_PADLOCK_SHA
71 $(LINUX_DIR
)/drivers
/crypto
/padlock-aes.ko \
72 $(LINUX_DIR
)/drivers
/crypto
/padlock-sha.ko
73 AUTOLOAD
:=$(call AutoLoad
,09,padlock-aes padlock-sha
)
74 $(call AddDepends
/crypto
)
77 $(eval
$(call KernelPackage
,crypto-hw-padlock
))
80 define KernelPackage
/crypto-hw-geode
81 TITLE
:=AMD Geode hardware crypto module
83 CONFIG_CRYPTO_DEV_GEODE
84 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/geode-aes.ko
85 AUTOLOAD
:=$(call AutoLoad
,09,geode-aes
)
86 $(call AddDepends
/crypto
)
89 $(eval
$(call KernelPackage
,crypto-hw-geode
))
92 define KernelPackage
/crypto-hw-hifn-795x
93 TITLE
:=HIFN
795x crypto accelerator
94 DEPENDS
:=@
!TARGET_ubicom32
97 CONFIG_CRYPTO_DEV_HIFN_795X \
98 CONFIG_CRYPTO_DEV_HIFN_795X_RNG
=y
99 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/hifn_795x.ko
100 AUTOLOAD
:=$(call AutoLoad
,09,hifn_795x
)
101 $(call AddDepends
/crypto
,+kmod-crypto-des
)
104 $(eval
$(call KernelPackage
,crypto-hw-hifn-795x
))
107 define KernelPackage
/crypto-hw-ixp4xx
108 TITLE
:=Intel IXP4xx hardware crypto module
109 DEPENDS
:=@TARGET_ixp4xx
111 CONFIG_CRYPTO_DEV_IXP4XX
112 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/ixp4xx_crypto.ko
113 AUTOLOAD
:=$(call AutoLoad
,90,ixp4xx_crypto
)
114 $(call AddDepends
/crypto
,+kmod-crypto-authenc
+kmod-crypto-des
)
117 define KernelPackage
/crypto-hw-ixp4xx
/description
118 Kernel support for the Intel IXP4xx HW crypto engine.
121 $(eval
$(call KernelPackage
,crypto-hw-ixp4xx
))
124 define KernelPackage
/crypto-hw-ppc4xx
125 TITLE
:=AMCC PPC4xx hardware crypto module
126 DEPENDS
:=@TARGET_ppc40x||TARGET_ppc44x
128 CONFIG_CRYPTO_DEV_PPC4XX
129 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/amcc
/crypto4xx.ko
130 AUTOLOAD
:=$(call AutoLoad
,90,crypto4xx
)
131 $(call AddDepends
/crypto
)
134 define KernelPackage
/crypto-hw-ppc4xx
/description
135 Kernel support for the AMCC PPC4xx HW crypto engine.
138 $(eval
$(call KernelPackage
,crypto-hw-ppc4xx
))
141 define KernelPackage
/crypto-aes
142 TITLE
:=AES cipher CryptoAPI module
143 KCONFIG
:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
144 FILES
:=$(LINUX_DIR
)/crypto
/aes
$(AES_SUFFIX
).ko
145 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
))
146 $(call AddDepends
/crypto
)
149 define KernelPackage
/crypto-aes
/x86
150 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/aes-i586.ko
151 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
) aes-i586
)
154 $(eval
$(call KernelPackage
,crypto-aes
))
157 define KernelPackage
/crypto-arc4
158 TITLE
:=ARC4
(RC4
) cipher CryptoAPI module
159 KCONFIG
:=CONFIG_CRYPTO_ARC4
160 FILES
:=$(LINUX_DIR
)/crypto
/arc4.ko
161 AUTOLOAD
:=$(call AutoLoad
,09,arc4
)
162 $(call AddDepends
/crypto
)
165 $(eval
$(call KernelPackage
,crypto-arc4
))
168 define KernelPackage
/crypto-authenc
169 TITLE
:=Combined mode wrapper for IPsec
170 KCONFIG
:=CONFIG_CRYPTO_AUTHENC
171 FILES
:=$(LINUX_DIR
)/crypto
/authenc.ko
172 AUTOLOAD
:=$(call AutoLoad
,09,authenc
)
173 $(call AddDepends
/crypto
)
176 $(eval
$(call KernelPackage
,crypto-authenc
))
178 define KernelPackage
/crypto-cbc
179 TITLE
:=Cipher Block Chaining CryptoAPI module
180 KCONFIG
:=CONFIG_CRYPTO_CBC
181 FILES
:=$(LINUX_DIR
)/crypto
/cbc.ko
182 AUTOLOAD
:=$(call AutoLoad
,09,cbc
)
183 $(call AddDepends
/crypto
)
186 $(eval
$(call KernelPackage
,crypto-cbc
))
188 define KernelPackage
/crypto-des
189 TITLE
:=DES
/3DES cipher CryptoAPI module
190 KCONFIG
:=CONFIG_CRYPTO_DES
191 FILES
:=$(LINUX_DIR
)/crypto
/des
$(DES_SUFFIX
).ko
192 AUTOLOAD
:=$(call AutoLoad
,09,des
$(DES_SUFFIX
))
193 $(call AddDepends
/crypto
)
196 $(eval
$(call KernelPackage
,crypto-des
))
198 define KernelPackage
/crypto-deflate
199 TITLE
:=Deflate compression CryptoAPI module
200 KCONFIG
:=CONFIG_CRYPTO_DEFLATE
201 FILES
:=$(LINUX_DIR
)/crypto
/deflate.ko
202 AUTOLOAD
:=$(call AutoLoad
,09,deflate
)
203 $(call AddDepends
/crypto
)
206 $(eval
$(call KernelPackage
,crypto-deflate
))
209 define KernelPackage
/crypto-hmac
210 TITLE
:=HMAC digest CryptoAPI module
211 KCONFIG
:=CONFIG_CRYPTO_HMAC
212 FILES
:=$(LINUX_DIR
)/crypto
/hmac.ko
213 AUTOLOAD
:=$(call AutoLoad
,09,hmac
)
214 $(call AddDepends
/crypto
)
217 $(eval
$(call KernelPackage
,crypto-hmac
))
220 define KernelPackage
/crypto-md5
221 TITLE
:=MD5 digest CryptoAPI module
222 KCONFIG
:=CONFIG_CRYPTO_MD5
223 FILES
:=$(LINUX_DIR
)/crypto
/md5.ko
224 AUTOLOAD
:=$(call AutoLoad
,09,md5
)
225 $(call AddDepends
/crypto
)
228 $(eval
$(call KernelPackage
,crypto-md5
))
231 define KernelPackage
/crypto-michael-mic
232 TITLE
:=Michael MIC keyed digest CryptoAPI module
233 KCONFIG
:=CONFIG_CRYPTO_MICHAEL_MIC
234 FILES
:=$(LINUX_DIR
)/crypto
/michael_mic.ko
235 AUTOLOAD
:=$(call AutoLoad
,09,michael_mic
)
236 $(call AddDepends
/crypto
)
239 $(eval
$(call KernelPackage
,crypto-michael-mic
))
242 define KernelPackage
/crypto-sha1
243 TITLE
:=SHA1 digest CryptoAPI module
244 KCONFIG
:=CONFIG_CRYPTO_SHA1
245 FILES
:=$(LINUX_DIR
)/crypto
/sha1
$(SHA1_SUFFIX
).ko
246 AUTOLOAD
:=$(call AutoLoad
,09,sha1
$(SHA1_SUFFIX
))
247 $(call AddDepends
/crypto
)
250 $(eval
$(call KernelPackage
,crypto-sha1
))
253 define KernelPackage
/crypto-misc
254 TITLE
:=Other CryptoAPI modules
256 CONFIG_CRYPTO_ANUBIS \
257 CONFIG_CRYPTO_BLOWFISH \
258 CONFIG_CRYPTO_CAMELLIA \
259 CONFIG_CRYPTO_CAST5 \
260 CONFIG_CRYPTO_CAST6 \
261 CONFIG_CRYPTO_CRC32C \
262 CONFIG_CRYPTO_FCRYPT \
263 CONFIG_CRYPTO_KHAZAD \
265 CONFIG_CRYPTO_SERPENT \
266 CONFIG_CRYPTO_SHA256 \
267 CONFIG_CRYPTO_SHA512 \
269 CONFIG_CRYPTO_TGR192 \
270 CONFIG_CRYPTO_TWOFISH \
271 CONFIG_CRYPTO_TWOFISH_COMMON \
272 CONFIG_CRYPTO_TWOFISH_586 \
275 $(LINUX_DIR
)/crypto
/anubis.ko \
276 $(LINUX_DIR
)/crypto
/blowfish.ko \
277 $(LINUX_DIR
)/crypto
/cast5.ko \
278 $(LINUX_DIR
)/crypto
/cast6.ko \
279 $(LINUX_DIR
)/crypto
/khazad.ko \
280 $(LINUX_DIR
)/crypto
/md4.ko \
281 $(LINUX_DIR
)/crypto
/serpent.ko \
282 $(LINUX_DIR
)/crypto
/sha256
$(SHA256_SUFFIX
).ko \
283 $(LINUX_DIR
)/crypto
/sha512
$(SHA512_SUFFIX
).ko \
284 $(LINUX_DIR
)/crypto
/tea.ko \
285 $(if
$(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),le
,2.6.35)),,$(LINUX_DIR
)/crypto
/twofish.ko
) \
286 $(if
$(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),ge
,2.6.36)),,$(LINUX_DIR
)/crypto
/twofish_generic.ko
) \
287 $(LINUX_DIR
)/crypto
/wp512.ko
288 $(call AddDepends
/crypto
)
291 define KernelPackage
/crypto-misc
/2.6
293 $(LINUX_DIR
)/crypto
/camellia.ko \
294 $(if
$(findstring y
,$(CONFIG_CRYPTO_CRC32C
)),,$(LINUX_DIR
)/crypto
/crc32c.ko
) \
295 $(LINUX_DIR
)/crypto
/fcrypt.ko \
296 $(LINUX_DIR
)/crypto
/tgr192.ko \
297 $(LINUX_DIR
)/crypto
/twofish_common.ko
300 define KernelPackage
/crypto-misc
/x86
301 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/twofish-i586.ko
304 $(eval
$(call KernelPackage
,crypto-misc
))
307 define KernelPackage
/crypto-ocf
309 DEPENDS
:=+@OPENSSL_ENGINE @
!TARGET_uml
312 CONFIG_OCF_CRYPTODEV \
313 CONFIG_OCF_CRYPTOSOFT \
315 CONFIG_OCF_RANDOMHARVEST
=y
317 $(LINUX_DIR
)/crypto
/ocf
/ocf.ko \
318 $(LINUX_DIR
)/crypto
/ocf
/cryptodev.ko \
319 $(LINUX_DIR
)/crypto
/ocf
/cryptosoft.ko
320 AUTOLOAD
:=$(call AutoLoad
,09, \
325 $(call AddDepends
/crypto
)
328 $(eval
$(call KernelPackage
,crypto-ocf
))
331 define KernelPackage
/crypto-ocf-hifn7751
332 TITLE
:=OCF support for Hifn
6500/7751/7811/795x
, Invertex AEON and NetSec
7751 devices
333 DEPENDS
:=+@OPENSSL_ENGINE @PCI_SUPPORT @
!TARGET_uml kmod-crypto-ocf
334 KCONFIG
:=CONFIG_OCF_HIFN
335 FILES
:=$(LINUX_DIR
)/crypto
/ocf
/hifn
/hifn7751.ko
336 AUTOLOAD
:=$(call AutoLoad
,10,hifn7751
)
337 $(call AddDepends
/crypto
)
340 $(eval
$(call KernelPackage
,crypto-ocf-hifn7751
))
343 define KernelPackage
/crypto-ocf-hifnhipp
344 TITLE
:=OCF support for Hifn
7855/8155 devices
345 DEPENDS
:=+@OPENSSL_ENGINE @PCI_SUPPORT @
!TARGET_uml kmod-crypto-ocf
346 KCONFIG
:=CONFIG_OCF_HIFNHIPP
347 FILES
:=$(LINUX_DIR
)/crypto
/ocf
/hifn
/hifnHIPP.ko
348 AUTOLOAD
:=$(call AutoLoad
,10,hifnhipp
)
349 $(call AddDepends
/crypto
)
352 $(eval
$(call KernelPackage
,crypto-ocf-hifnhipp
))
355 define KernelPackage
/crypto-null
356 TITLE
:=Null CryptoAPI module
357 KCONFIG
:=CONFIG_CRYPTO_NULL
358 FILES
:=$(LINUX_DIR
)/crypto
/crypto_null.ko
359 AUTOLOAD
:=$(call AutoLoad
,09,crypto_null
)
360 $(call AddDepends
/crypto
)
363 $(eval
$(call KernelPackage
,crypto-null
))
366 define KernelPackage
/crypto-test
367 TITLE
:=Test CryptoAPI module
368 KCONFIG
:=CONFIG_CRYPTO_TEST
369 FILES
:=$(LINUX_DIR
)/crypto
/tcrypt.ko
370 $(call AddDepends
/crypto
)
373 $(eval
$(call KernelPackage
,crypto-test
))
376 define KernelPackage
/crypto-xts
377 TITLE
:=XTS cipher CryptoAPI module
379 CONFIG_CRYPTO_GF128MUL \
382 $(LINUX_DIR
)/crypto
/xts.ko \
383 $(LINUX_DIR
)/crypto
/gf128mul.ko
384 AUTOLOAD
:=$(call AutoLoad
,09, \
388 $(call AddDepends
/crypto
)
391 $(eval
$(call KernelPackage
,crypto-xts
))
393 define KernelPackage
/crypto-mv-cesa
394 TITLE
:=Marvell crypto engine
395 KCONFIG
:=CONFIG_CRYPTO_DEV_MV_CESA
396 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/mv_cesa.ko
397 AUTOLOAD
:=$(call AutoLoad
,09,mv_cesa
)
398 SUBMENU
:=Cryptographic API modules
399 DEPENDS
:=kmod-crypto-core @TARGET_kirkwood||TARGET_orion
402 $(eval
$(call KernelPackage
,crypto-mv-cesa
))