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 $(if
$(filter 1,$(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),ge
,2.6.28)),ALGAPI2
,ALGAPI
)=crypto_algapi \
27 $(if
$(filter 1,$(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),ge
,2.6.36)),PCOMP2
,PCOMP
)=pcompress \
28 BLKCIPHER2
=crypto_blkcipher \
34 crypto_confvar
=CONFIG_CRYPTO_
$(word 1,$(subst =,$(space
),$(1)))
35 crypto_file
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(LINUX_DIR
)/crypto
/$(word 2,$(subst =,$(space
),$(1))).ko
)
36 crypto_name
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(word 2,$(subst =,$(space
),$(1))))
38 # XXX: added CONFIG_CRYPTO_HMAC to KCONFIG so that CONFIG_CRYPTO_HASH is
39 # always set, even if no hash modules are selected
40 define KernelPackage
/crypto-core
41 SUBMENU
:=$(CRYPTO_MENU
)
42 TITLE
:=Core CryptoAPI modules
47 $(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_confvar
,$(mod
)))
48 FILES
:=$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_file
,$(mod
)))
49 AUTOLOAD
:=$(call AutoLoad
,01,$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_name
,$(mod
))))
51 $(eval
$(call KernelPackage
,crypto-core
))
54 define AddDepends
/crypto
55 SUBMENU
:=$(CRYPTO_MENU
)
56 DEPENDS
+=kmod-crypto-core
$(1)
60 define KernelPackage
/crypto-hw-padlock
61 TITLE
:=VIA PadLock ACE with AES
/SHA hw crypto module
62 DEPENDS
:=+kmod-crypto-aes
64 CONFIG_CRYPTO_DEV_PADLOCK \
65 CONFIG_CRYPTO_DEV_PADLOCK_AES \
66 CONFIG_CRYPTO_DEV_PADLOCK_SHA
68 $(LINUX_DIR
)/drivers
/crypto
/padlock-aes.ko \
69 $(LINUX_DIR
)/drivers
/crypto
/padlock-sha.ko
70 AUTOLOAD
:=$(call AutoLoad
,09,padlock-aes padlock-sha
)
71 $(call AddDepends
/crypto
)
74 $(eval
$(call KernelPackage
,crypto-hw-padlock
))
77 define KernelPackage
/crypto-hw-geode
78 TITLE
:=AMD Geode hardware crypto module
80 CONFIG_CRYPTO_DEV_GEODE
81 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/geode-aes.ko
82 AUTOLOAD
:=$(call AutoLoad
,09,geode-aes
)
83 $(call AddDepends
/crypto
)
86 $(eval
$(call KernelPackage
,crypto-hw-geode
))
89 define KernelPackage
/crypto-hw-hifn-795x
90 TITLE
:=HIFN
795x crypto accelerator
91 DEPENDS
:=@
!TARGET_ubicom32
94 CONFIG_CRYPTO_DEV_HIFN_795X \
95 CONFIG_CRYPTO_DEV_HIFN_795X_RNG
=y
96 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/hifn_795x.ko
97 AUTOLOAD
:=$(call AutoLoad
,09,hifn_795x
)
98 $(call AddDepends
/crypto
,+kmod-crypto-des
)
101 $(eval
$(call KernelPackage
,crypto-hw-hifn-795x
))
104 define KernelPackage
/crypto-hw-ixp4xx
105 TITLE
:=Intel IXP4xx hardware crypto module
106 DEPENDS
:=@TARGET_ixp4xx
108 CONFIG_CRYPTO_DEV_IXP4XX
109 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/ixp4xx_crypto.ko
110 AUTOLOAD
:=$(call AutoLoad
,90,ixp4xx_crypto
)
111 $(call AddDepends
/crypto
,+kmod-crypto-authenc
+kmod-crypto-des
)
114 define KernelPackage
/crypto-hw-ixp4xx
/description
115 Kernel support for the Intel IXP4xx HW crypto engine.
118 $(eval
$(call KernelPackage
,crypto-hw-ixp4xx
))
121 define KernelPackage
/crypto-hw-ppc4xx
122 TITLE
:=AMCC PPC4xx hardware crypto module
123 DEPENDS
:=@TARGET_ppc40x||TARGET_ppc44x
125 CONFIG_CRYPTO_DEV_PPC4XX
126 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/amcc
/crypto4xx.ko
127 AUTOLOAD
:=$(call AutoLoad
,90,crypto4xx
)
128 $(call AddDepends
/crypto
)
131 define KernelPackage
/crypto-hw-ppc4xx
/description
132 Kernel support for the AMCC PPC4xx HW crypto engine.
135 $(eval
$(call KernelPackage
,crypto-hw-ppc4xx
))
138 define KernelPackage
/crypto-aes
139 TITLE
:=AES cipher CryptoAPI module
140 KCONFIG
:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
141 FILES
:=$(LINUX_DIR
)/crypto
/aes
$(AES_SUFFIX
).ko
142 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
))
143 $(call AddDepends
/crypto
)
146 define KernelPackage
/crypto-aes
/x86
147 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/aes-i586.ko
148 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
) aes-i586
)
151 $(eval
$(call KernelPackage
,crypto-aes
))
154 define KernelPackage
/crypto-arc4
155 TITLE
:=ARC4
(RC4
) cipher CryptoAPI module
156 KCONFIG
:=CONFIG_CRYPTO_ARC4
157 FILES
:=$(LINUX_DIR
)/crypto
/arc4.ko
158 AUTOLOAD
:=$(call AutoLoad
,09,arc4
)
159 $(call AddDepends
/crypto
)
162 $(eval
$(call KernelPackage
,crypto-arc4
))
165 define KernelPackage
/crypto-authenc
166 TITLE
:=Combined mode wrapper for IPsec
167 KCONFIG
:=CONFIG_CRYPTO_AUTHENC
168 FILES
:=$(LINUX_DIR
)/crypto
/authenc.ko
169 AUTOLOAD
:=$(call AutoLoad
,09,authenc
)
170 $(call AddDepends
/crypto
)
173 $(eval
$(call KernelPackage
,crypto-authenc
))
175 define KernelPackage
/crypto-des
176 TITLE
:=DES
/3DES cipher CryptoAPI module
177 KCONFIG
:=CONFIG_CRYPTO_DES
178 FILES
:=$(LINUX_DIR
)/crypto
/des
$(DES_SUFFIX
).ko
179 AUTOLOAD
:=$(call AutoLoad
,09,des
$(DES_SUFFIX
))
180 $(call AddDepends
/crypto
)
183 $(eval
$(call KernelPackage
,crypto-des
))
185 define KernelPackage
/crypto-deflate
186 TITLE
:=Deflate compression CryptoAPI module
187 KCONFIG
:=CONFIG_CRYPTO_DEFLATE
188 FILES
:=$(LINUX_DIR
)/crypto
/deflate.ko
189 AUTOLOAD
:=$(call AutoLoad
,09,deflate
)
190 $(call AddDepends
/crypto
)
193 $(eval
$(call KernelPackage
,crypto-deflate
))
196 define KernelPackage
/crypto-hmac
197 TITLE
:=HMAC digest CryptoAPI module
198 KCONFIG
:=CONFIG_CRYPTO_HMAC
199 FILES
:=$(LINUX_DIR
)/crypto
/hmac.ko
200 AUTOLOAD
:=$(call AutoLoad
,09,hmac
)
201 $(call AddDepends
/crypto
)
204 $(eval
$(call KernelPackage
,crypto-hmac
))
207 define KernelPackage
/crypto-md5
208 TITLE
:=MD5 digest CryptoAPI module
209 KCONFIG
:=CONFIG_CRYPTO_MD5
210 FILES
:=$(LINUX_DIR
)/crypto
/md5.ko
211 AUTOLOAD
:=$(call AutoLoad
,09,md5
)
212 $(call AddDepends
/crypto
)
215 $(eval
$(call KernelPackage
,crypto-md5
))
218 define KernelPackage
/crypto-michael-mic
219 TITLE
:=Michael MIC keyed digest CryptoAPI module
220 KCONFIG
:=CONFIG_CRYPTO_MICHAEL_MIC
221 FILES
:=$(LINUX_DIR
)/crypto
/michael_mic.ko
222 AUTOLOAD
:=$(call AutoLoad
,09,michael_mic
)
223 $(call AddDepends
/crypto
)
226 $(eval
$(call KernelPackage
,crypto-michael-mic
))
229 define KernelPackage
/crypto-sha1
230 TITLE
:=SHA1 digest CryptoAPI module
231 KCONFIG
:=CONFIG_CRYPTO_SHA1
232 FILES
:=$(LINUX_DIR
)/crypto
/sha1
$(SHA1_SUFFIX
).ko
233 AUTOLOAD
:=$(call AutoLoad
,09,sha1
$(SHA1_SUFFIX
))
234 $(call AddDepends
/crypto
)
237 $(eval
$(call KernelPackage
,crypto-sha1
))
240 define KernelPackage
/crypto-misc
241 TITLE
:=Other CryptoAPI modules
243 CONFIG_CRYPTO_ANUBIS \
244 CONFIG_CRYPTO_BLOWFISH \
245 CONFIG_CRYPTO_CAMELLIA \
246 CONFIG_CRYPTO_CAST5 \
247 CONFIG_CRYPTO_CAST6 \
248 CONFIG_CRYPTO_CRC32C \
249 CONFIG_CRYPTO_FCRYPT \
250 CONFIG_CRYPTO_KHAZAD \
252 CONFIG_CRYPTO_SERPENT \
253 CONFIG_CRYPTO_SHA256 \
254 CONFIG_CRYPTO_SHA512 \
256 CONFIG_CRYPTO_TGR192 \
257 CONFIG_CRYPTO_TWOFISH \
258 CONFIG_CRYPTO_TWOFISH_COMMON \
259 CONFIG_CRYPTO_TWOFISH_586 \
262 $(LINUX_DIR
)/crypto
/anubis.ko \
263 $(LINUX_DIR
)/crypto
/blowfish.ko \
264 $(LINUX_DIR
)/crypto
/cast5.ko \
265 $(LINUX_DIR
)/crypto
/cast6.ko \
266 $(LINUX_DIR
)/crypto
/khazad.ko \
267 $(LINUX_DIR
)/crypto
/md4.ko \
268 $(LINUX_DIR
)/crypto
/serpent.ko \
269 $(LINUX_DIR
)/crypto
/sha256
$(SHA256_SUFFIX
).ko \
270 $(LINUX_DIR
)/crypto
/sha512
$(SHA512_SUFFIX
).ko \
271 $(LINUX_DIR
)/crypto
/tea.ko \
272 $(if
$(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),le
,2.6.35)),,$(LINUX_DIR
)/crypto
/twofish.ko
) \
273 $(if
$(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),ge
,2.6.36)),,$(LINUX_DIR
)/crypto
/twofish_generic.ko
) \
274 $(LINUX_DIR
)/crypto
/wp512.ko
275 $(call AddDepends
/crypto
)
278 define KernelPackage
/crypto-misc
/2.6
280 $(LINUX_DIR
)/crypto
/camellia.ko \
281 $(if
$(findstring y
,$(CONFIG_CRYPTO_CRC32C
)),,$(LINUX_DIR
)/crypto
/crc32c.ko
) \
282 $(LINUX_DIR
)/crypto
/fcrypt.ko \
283 $(LINUX_DIR
)/crypto
/tgr192.ko \
284 $(LINUX_DIR
)/crypto
/twofish_common.ko
287 define KernelPackage
/crypto-misc
/x86
288 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/twofish-i586.ko
291 $(eval
$(call KernelPackage
,crypto-misc
))
294 define KernelPackage
/crypto-ocf
296 DEPENDS
:=+@OPENSSL_ENGINE @
!TARGET_uml
299 CONFIG_OCF_CRYPTODEV \
300 CONFIG_OCF_CRYPTOSOFT \
302 CONFIG_OCF_RANDOMHARVEST
=y
304 $(LINUX_DIR
)/crypto
/ocf
/ocf.ko \
305 $(LINUX_DIR
)/crypto
/ocf
/cryptodev.ko \
306 $(LINUX_DIR
)/crypto
/ocf
/cryptosoft.ko
307 AUTOLOAD
:=$(call AutoLoad
,09, \
312 $(call AddDepends
/crypto
)
315 $(eval
$(call KernelPackage
,crypto-ocf
))
318 define KernelPackage
/crypto-ocf-hifn7751
319 TITLE
:=OCF support for Hifn
6500/7751/7811/795x
, Invertex AEON and NetSec
7751 devices
320 DEPENDS
:=+@OPENSSL_ENGINE @PCI_SUPPORT @
!TARGET_uml kmod-crypto-ocf
321 KCONFIG
:=CONFIG_OCF_HIFN
322 FILES
:=$(LINUX_DIR
)/crypto
/ocf
/hifn
/hifn7751.ko
323 AUTOLOAD
:=$(call AutoLoad
,10,hifn7751
)
324 $(call AddDepends
/crypto
)
327 $(eval
$(call KernelPackage
,crypto-ocf-hifn7751
))
330 define KernelPackage
/crypto-ocf-hifnhipp
331 TITLE
:=OCF support for Hifn
7855/8155 devices
332 DEPENDS
:=+@OPENSSL_ENGINE @PCI_SUPPORT @
!TARGET_uml kmod-crypto-ocf
333 KCONFIG
:=CONFIG_OCF_HIFNHIPP
334 FILES
:=$(LINUX_DIR
)/crypto
/ocf
/hifn
/hifnHIPP.ko
335 AUTOLOAD
:=$(call AutoLoad
,10,hifnhipp
)
336 $(call AddDepends
/crypto
)
339 $(eval
$(call KernelPackage
,crypto-ocf-hifnhipp
))
342 define KernelPackage
/crypto-null
343 TITLE
:=Null CryptoAPI module
344 KCONFIG
:=CONFIG_CRYPTO_NULL
345 FILES
:=$(LINUX_DIR
)/crypto
/crypto_null.ko
346 AUTOLOAD
:=$(call AutoLoad
,09,crypto_null
)
347 $(call AddDepends
/crypto
)
350 $(eval
$(call KernelPackage
,crypto-null
))
353 define KernelPackage
/crypto-test
354 TITLE
:=Test CryptoAPI module
355 KCONFIG
:=CONFIG_CRYPTO_TEST
356 FILES
:=$(LINUX_DIR
)/crypto
/tcrypt.ko
357 $(call AddDepends
/crypto
)
360 $(eval
$(call KernelPackage
,crypto-test
))
363 define KernelPackage
/crypto-xts
364 TITLE
:=XTS cipher CryptoAPI module
366 CONFIG_CRYPTO_GF128MUL \
369 $(LINUX_DIR
)/crypto
/xts.ko \
370 $(LINUX_DIR
)/crypto
/gf128mul.ko
371 AUTOLOAD
:=$(call AutoLoad
,09, \
375 $(call AddDepends
/crypto
)
378 $(eval
$(call KernelPackage
,crypto-xts
))
380 define KernelPackage
/crypto-mv-cesa
381 TITLE
:=Marvell crypto engine
382 KCONFIG
:=CONFIG_CRYPTO_DEV_MV_CESA
383 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/mv_cesa.ko
384 AUTOLOAD
:=$(call AutoLoad
,09,mv_cesa
)
385 SUBMENU
:=Cryptographic API modules
386 DEPENDS
:=kmod-crypto-core @TARGET_kirkwood||TARGET_orion
389 $(eval
$(call KernelPackage
,crypto-mv-cesa
))