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 $(if
$(filter 1,$(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),ge
,2.6.36)),PCOMP2
,PCOMP
)=pcompress \
28 BLKCIPHER2
=crypto_blkcipher \
33 crypto_confvar
=CONFIG_CRYPTO_
$(word 1,$(subst =,$(space
),$(1)))
34 crypto_file
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(LINUX_DIR
)/crypto
/$(word 2,$(subst =,$(space
),$(1))).ko
)
35 crypto_name
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(word 2,$(subst =,$(space
),$(1))))
37 # XXX: added CONFIG_CRYPTO_HMAC to KCONFIG so that CONFIG_CRYPTO_HASH is
38 # always set, even if no hash modules are selected
39 define KernelPackage
/crypto-core
40 SUBMENU
:=$(CRYPTO_MENU
)
41 TITLE
:=Core CryptoAPI modules
46 $(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_confvar
,$(mod
)))
47 FILES
:=$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_file
,$(mod
)))
48 AUTOLOAD
:=$(call AutoLoad
,01,$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_name
,$(mod
))))
50 $(eval
$(call KernelPackage
,crypto-core
))
53 define AddDepends
/crypto
54 SUBMENU
:=$(CRYPTO_MENU
)
55 DEPENDS
+=kmod-crypto-core
$(1)
59 define KernelPackage
/crypto-hw-padlock
60 TITLE
:=VIA PadLock ACE with AES
/SHA hw crypto module
61 DEPENDS
:=+kmod-crypto-aes
63 CONFIG_CRYPTO_DEV_PADLOCK \
64 CONFIG_CRYPTO_DEV_PADLOCK_AES \
65 CONFIG_CRYPTO_DEV_PADLOCK_SHA
67 $(LINUX_DIR
)/drivers
/crypto
/padlock-aes.ko \
68 $(LINUX_DIR
)/drivers
/crypto
/padlock-sha.ko
69 AUTOLOAD
:=$(call AutoLoad
,09,padlock-aes padlock-sha
)
70 $(call AddDepends
/crypto
)
73 $(eval
$(call KernelPackage
,crypto-hw-padlock
))
76 define KernelPackage
/crypto-hw-geode
77 TITLE
:=AMD Geode hardware crypto module
79 CONFIG_CRYPTO_DEV_GEODE
80 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/geode-aes.ko
81 AUTOLOAD
:=$(call AutoLoad
,09,geode-aes
)
82 $(call AddDepends
/crypto
)
85 $(eval
$(call KernelPackage
,crypto-hw-geode
))
88 define KernelPackage
/crypto-hw-hifn-795x
89 TITLE
:=HIFN
795x crypto accelerator
90 DEPENDS
:=@
!TARGET_ubicom32
93 CONFIG_CRYPTO_DEV_HIFN_795X \
94 CONFIG_CRYPTO_DEV_HIFN_795X_RNG
=y
95 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/hifn_795x.ko
96 AUTOLOAD
:=$(call AutoLoad
,09,hifn_795x
)
97 $(call AddDepends
/crypto
,+kmod-crypto-des
)
100 $(eval
$(call KernelPackage
,crypto-hw-hifn-795x
))
103 define KernelPackage
/crypto-hw-ixp4xx
104 TITLE
:=Intel IXP4xx hardware crypto module
105 DEPENDS
:=@TARGET_ixp4xx
107 CONFIG_CRYPTO_DEV_IXP4XX
108 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/ixp4xx_crypto.ko
109 AUTOLOAD
:=$(call AutoLoad
,90,ixp4xx_crypto
)
110 $(call AddDepends
/crypto
,+kmod-crypto-authenc
+kmod-crypto-des
)
113 define KernelPackage
/crypto-hw-ixp4xx
/description
114 Kernel support for the Intel IXP4xx HW crypto engine.
117 $(eval
$(call KernelPackage
,crypto-hw-ixp4xx
))
120 define KernelPackage
/crypto-hw-ppc4xx
121 TITLE
:=AMCC PPC4xx hardware crypto module
122 DEPENDS
:=@TARGET_ppc40x||TARGET_ppc44x
124 CONFIG_CRYPTO_DEV_PPC4XX
125 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/amcc
/crypto4xx.ko
126 AUTOLOAD
:=$(call AutoLoad
,90,crypto4xx
)
127 $(call AddDepends
/crypto
)
130 define KernelPackage
/crypto-hw-ppc4xx
/description
131 Kernel support for the AMCC PPC4xx HW crypto engine.
134 $(eval
$(call KernelPackage
,crypto-hw-ppc4xx
))
137 define KernelPackage
/crypto-aes
138 TITLE
:=AES cipher CryptoAPI module
139 KCONFIG
:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
140 FILES
:=$(LINUX_DIR
)/crypto
/aes
$(AES_SUFFIX
).ko
141 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
))
142 $(call AddDepends
/crypto
)
145 define KernelPackage
/crypto-aes
/x86
146 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/aes-i586.ko
147 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
) aes-i586
)
150 $(eval
$(call KernelPackage
,crypto-aes
))
153 define KernelPackage
/crypto-arc4
154 TITLE
:=ARC4
(RC4
) cipher CryptoAPI module
155 KCONFIG
:=CONFIG_CRYPTO_ARC4
156 FILES
:=$(LINUX_DIR
)/crypto
/arc4.ko
157 AUTOLOAD
:=$(call AutoLoad
,09,arc4
)
158 $(call AddDepends
/crypto
)
161 $(eval
$(call KernelPackage
,crypto-arc4
))
164 define KernelPackage
/crypto-authenc
165 TITLE
:=Combined mode wrapper for IPsec
166 KCONFIG
:=CONFIG_CRYPTO_AUTHENC
167 FILES
:=$(LINUX_DIR
)/crypto
/authenc.ko
168 AUTOLOAD
:=$(call AutoLoad
,09,authenc
)
169 $(call AddDepends
/crypto
)
172 $(eval
$(call KernelPackage
,crypto-authenc
))
174 define KernelPackage
/crypto-cbc
175 TITLE
:=Cipher Block Chaining CryptoAPI module
176 KCONFIG
:=CONFIG_CRYPTO_CBC
177 FILES
:=$(LINUX_DIR
)/crypto
/cbc.ko
178 AUTOLOAD
:=$(call AutoLoad
,09,cbc
)
179 $(call AddDepends
/crypto
)
182 $(eval
$(call KernelPackage
,crypto-cbc
))
184 define KernelPackage
/crypto-des
185 TITLE
:=DES
/3DES cipher CryptoAPI module
186 KCONFIG
:=CONFIG_CRYPTO_DES
187 FILES
:=$(LINUX_DIR
)/crypto
/des
$(DES_SUFFIX
).ko
188 AUTOLOAD
:=$(call AutoLoad
,09,des
$(DES_SUFFIX
))
189 $(call AddDepends
/crypto
)
192 $(eval
$(call KernelPackage
,crypto-des
))
194 define KernelPackage
/crypto-deflate
195 TITLE
:=Deflate compression CryptoAPI module
196 KCONFIG
:=CONFIG_CRYPTO_DEFLATE
197 FILES
:=$(LINUX_DIR
)/crypto
/deflate.ko
198 AUTOLOAD
:=$(call AutoLoad
,09,deflate
)
199 $(call AddDepends
/crypto
)
202 $(eval
$(call KernelPackage
,crypto-deflate
))
205 define KernelPackage
/crypto-hmac
206 TITLE
:=HMAC digest CryptoAPI module
207 KCONFIG
:=CONFIG_CRYPTO_HMAC
208 FILES
:=$(LINUX_DIR
)/crypto
/hmac.ko
209 AUTOLOAD
:=$(call AutoLoad
,09,hmac
)
210 $(call AddDepends
/crypto
)
213 $(eval
$(call KernelPackage
,crypto-hmac
))
216 define KernelPackage
/crypto-md5
217 TITLE
:=MD5 digest CryptoAPI module
218 KCONFIG
:=CONFIG_CRYPTO_MD5
219 FILES
:=$(LINUX_DIR
)/crypto
/md5.ko
220 AUTOLOAD
:=$(call AutoLoad
,09,md5
)
221 $(call AddDepends
/crypto
)
224 $(eval
$(call KernelPackage
,crypto-md5
))
227 define KernelPackage
/crypto-michael-mic
228 TITLE
:=Michael MIC keyed digest CryptoAPI module
229 KCONFIG
:=CONFIG_CRYPTO_MICHAEL_MIC
230 FILES
:=$(LINUX_DIR
)/crypto
/michael_mic.ko
231 AUTOLOAD
:=$(call AutoLoad
,09,michael_mic
)
232 $(call AddDepends
/crypto
)
235 $(eval
$(call KernelPackage
,crypto-michael-mic
))
238 define KernelPackage
/crypto-sha1
239 TITLE
:=SHA1 digest CryptoAPI module
240 KCONFIG
:=CONFIG_CRYPTO_SHA1
241 FILES
:=$(LINUX_DIR
)/crypto
/sha1
$(SHA1_SUFFIX
).ko
242 AUTOLOAD
:=$(call AutoLoad
,09,sha1
$(SHA1_SUFFIX
))
243 $(call AddDepends
/crypto
)
246 $(eval
$(call KernelPackage
,crypto-sha1
))
249 define KernelPackage
/crypto-misc
250 TITLE
:=Other CryptoAPI modules
252 CONFIG_CRYPTO_ANUBIS \
253 CONFIG_CRYPTO_BLOWFISH \
254 CONFIG_CRYPTO_CAMELLIA \
255 CONFIG_CRYPTO_CAST5 \
256 CONFIG_CRYPTO_CAST6 \
257 CONFIG_CRYPTO_CRC32C \
258 CONFIG_CRYPTO_FCRYPT \
259 CONFIG_CRYPTO_KHAZAD \
261 CONFIG_CRYPTO_SERPENT \
262 CONFIG_CRYPTO_SHA256 \
263 CONFIG_CRYPTO_SHA512 \
265 CONFIG_CRYPTO_TGR192 \
266 CONFIG_CRYPTO_TWOFISH \
267 CONFIG_CRYPTO_TWOFISH_COMMON \
268 CONFIG_CRYPTO_TWOFISH_586 \
271 $(LINUX_DIR
)/crypto
/anubis.ko \
272 $(LINUX_DIR
)/crypto
/blowfish.ko \
273 $(LINUX_DIR
)/crypto
/cast5.ko \
274 $(LINUX_DIR
)/crypto
/cast6.ko \
275 $(LINUX_DIR
)/crypto
/khazad.ko \
276 $(LINUX_DIR
)/crypto
/md4.ko \
277 $(LINUX_DIR
)/crypto
/serpent.ko \
278 $(LINUX_DIR
)/crypto
/sha256
$(SHA256_SUFFIX
).ko \
279 $(LINUX_DIR
)/crypto
/sha512
$(SHA512_SUFFIX
).ko \
280 $(LINUX_DIR
)/crypto
/tea.ko \
281 $(if
$(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),le
,2.6.35)),,$(LINUX_DIR
)/crypto
/twofish.ko
) \
282 $(if
$(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),ge
,2.6.36)),,$(LINUX_DIR
)/crypto
/twofish_generic.ko
) \
283 $(LINUX_DIR
)/crypto
/wp512.ko
284 $(call AddDepends
/crypto
)
287 define KernelPackage
/crypto-misc
/2.6
289 $(LINUX_DIR
)/crypto
/camellia.ko \
290 $(if
$(findstring y
,$(CONFIG_CRYPTO_CRC32C
)),,$(LINUX_DIR
)/crypto
/crc32c.ko
) \
291 $(LINUX_DIR
)/crypto
/fcrypt.ko \
292 $(LINUX_DIR
)/crypto
/tgr192.ko \
293 $(LINUX_DIR
)/crypto
/twofish_common.ko
296 define KernelPackage
/crypto-misc
/x86
297 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/twofish-i586.ko
300 $(eval
$(call KernelPackage
,crypto-misc
))
303 define KernelPackage
/crypto-ocf
305 DEPENDS
:=+@OPENSSL_ENGINE @
!TARGET_uml
308 CONFIG_OCF_CRYPTODEV \
309 CONFIG_OCF_CRYPTOSOFT \
311 CONFIG_OCF_RANDOMHARVEST
=y
313 $(LINUX_DIR
)/crypto
/ocf
/ocf.ko \
314 $(LINUX_DIR
)/crypto
/ocf
/cryptodev.ko \
315 $(LINUX_DIR
)/crypto
/ocf
/cryptosoft.ko
316 AUTOLOAD
:=$(call AutoLoad
,09, \
321 $(call AddDepends
/crypto
)
324 $(eval
$(call KernelPackage
,crypto-ocf
))
327 define KernelPackage
/crypto-ocf-hifn7751
328 TITLE
:=OCF support for Hifn
6500/7751/7811/795x
, Invertex AEON and NetSec
7751 devices
329 DEPENDS
:=+@OPENSSL_ENGINE @PCI_SUPPORT @
!TARGET_uml kmod-crypto-ocf
330 KCONFIG
:=CONFIG_OCF_HIFN
331 FILES
:=$(LINUX_DIR
)/crypto
/ocf
/hifn
/hifn7751.ko
332 AUTOLOAD
:=$(call AutoLoad
,10,hifn7751
)
333 $(call AddDepends
/crypto
)
336 $(eval
$(call KernelPackage
,crypto-ocf-hifn7751
))
339 define KernelPackage
/crypto-ocf-hifnhipp
340 TITLE
:=OCF support for Hifn
7855/8155 devices
341 DEPENDS
:=+@OPENSSL_ENGINE @PCI_SUPPORT @
!TARGET_uml kmod-crypto-ocf
342 KCONFIG
:=CONFIG_OCF_HIFNHIPP
343 FILES
:=$(LINUX_DIR
)/crypto
/ocf
/hifn
/hifnHIPP.ko
344 AUTOLOAD
:=$(call AutoLoad
,10,hifnhipp
)
345 $(call AddDepends
/crypto
)
348 $(eval
$(call KernelPackage
,crypto-ocf-hifnhipp
))
351 define KernelPackage
/crypto-null
352 TITLE
:=Null CryptoAPI module
353 KCONFIG
:=CONFIG_CRYPTO_NULL
354 FILES
:=$(LINUX_DIR
)/crypto
/crypto_null.ko
355 AUTOLOAD
:=$(call AutoLoad
,09,crypto_null
)
356 $(call AddDepends
/crypto
)
359 $(eval
$(call KernelPackage
,crypto-null
))
362 define KernelPackage
/crypto-test
363 TITLE
:=Test CryptoAPI module
364 KCONFIG
:=CONFIG_CRYPTO_TEST
365 FILES
:=$(LINUX_DIR
)/crypto
/tcrypt.ko
366 $(call AddDepends
/crypto
)
369 $(eval
$(call KernelPackage
,crypto-test
))
372 define KernelPackage
/crypto-xts
373 TITLE
:=XTS cipher CryptoAPI module
375 CONFIG_CRYPTO_GF128MUL \
378 $(LINUX_DIR
)/crypto
/xts.ko \
379 $(LINUX_DIR
)/crypto
/gf128mul.ko
380 AUTOLOAD
:=$(call AutoLoad
,09, \
384 $(call AddDepends
/crypto
)
387 $(eval
$(call KernelPackage
,crypto-xts
))
389 define KernelPackage
/crypto-mv-cesa
390 TITLE
:=Marvell crypto engine
391 KCONFIG
:=CONFIG_CRYPTO_DEV_MV_CESA
392 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/mv_cesa.ko
393 AUTOLOAD
:=$(call AutoLoad
,09,mv_cesa
)
394 SUBMENU
:=Cryptographic API modules
395 DEPENDS
:=kmod-crypto-core @TARGET_kirkwood||TARGET_orion
398 $(eval
$(call KernelPackage
,crypto-mv-cesa
))