2 # Copyright (C) 2006-2008 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 ifeq ($(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),ge
,2.6.24)),1)
18 CRYPTO_GENERIC
:=_generic
19 AES_SUFFIX
:=$(CRYPTO_GENERIC
)
20 DES_SUFFIX
:=$(CRYPTO_GENERIC
)
21 SHA1_SUFFIX
:=$(CRYPTO_GENERIC
)
22 SHA256_SUFFIX
:=$(CRYPTO_GENERIC
)
24 ifeq ($(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),ge
,2.6.25)),1)
25 CRYPTO_PREFIX
:=crypto_
26 BLKCIPHER_PREFIX
:=$(CRYPTO_PREFIX
)
28 ifeq ($(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),ge
,2.6.26)),1)
29 SHA512_SUFFIX
:=$(CRYPTO_GENERIC
)
33 BLKCIPHER_CONF
:=BLKCIPHER
35 ifeq ($(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),ge
,2.6.30)),1)
36 CRYPTO_MODULE_PCOMPRESS
:=PCOMP
=pcompress
38 MANAGER_CONF
:=MANAGER2
39 BLKCIPHER_CONF
:=BLKCIPHER2
44 ALGAPI
=crypto_algapi \
46 $(CRYPTO_MODULE_PCOMPRESS
) \
47 $(BLKCIPHER_CONF
)=$(BLKCIPHER_PREFIX
)blkcipher \
48 $(HASH_CONF
)=crypto_hash \
49 $(MANAGER_CONF
)=cryptomgr \
54 crypto_confvar
=CONFIG_CRYPTO_
$(word 1,$(subst =,$(space
),$(1)))
55 crypto_file
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(LINUX_DIR
)/crypto
/$(word 2,$(subst =,$(space
),$(1))).
$(LINUX_KMOD_SUFFIX
))
56 crypto_name
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(word 2,$(subst =,$(space
),$(1))))
58 # XXX: added CONFIG_CRYPTO_HMAC to KCONFIG so that CONFIG_CRYPTO_HASH is
59 # always set, even if no hash modules are selected
60 define KernelPackage
/crypto-core
61 SUBMENU
:=$(CRYPTO_MENU
)
62 TITLE
:=Core CryptoAPI modules
63 KCONFIG
:=CONFIG_CRYPTO
=y CONFIG_CRYPTO_HMAC
$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_confvar
,$(mod
)))
64 FILES
:=$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_file
,$(mod
)))
65 AUTOLOAD
:=$(call AutoLoad
,01,$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_name
,$(mod
))))
68 define KernelPackage
/crypto-core
/2.4
69 FILES
:=$(LINUX_DIR
)/crypto
/deflate.
$(LINUX_KMOD_SUFFIX
)
70 AUTOLOAD
:=$(call AutoLoad
,01, deflate
)
73 $(eval
$(call KernelPackage
,crypto-core
))
76 define KernelPackage
/crypto-hw-padlock
77 SUBMENU
:=$(CRYPTO_MENU
)
78 TITLE
:=VIA PadLock ACE with AES
/SHA hw crypto module
79 DEPENDS
:=+kmod-crypto-core
82 CONFIG_CRYPTO_DEV_PADLOCK \
83 CONFIG_CRYPTO_DEV_PADLOCK_AES \
84 CONFIG_CRYPTO_DEV_PADLOCK_SHA
86 $(LINUX_DIR
)/drivers
/crypto
/padlock-aes.
$(LINUX_KMOD_SUFFIX
) \
87 $(LINUX_DIR
)/drivers
/crypto
/padlock-sha.
$(LINUX_KMOD_SUFFIX
)
88 AUTOLOAD
:=$(call AutoLoad
,09,padlock-aes padlock-sha
)
91 $(eval
$(call KernelPackage
,crypto-hw-padlock
))
94 define KernelPackage
/crypto-hw-geode
95 SUBMENU
:=$(CRYPTO_MENU
)
96 TITLE
:=AMD Geode hardware crypto module
97 DEPENDS
:=+kmod-crypto-core
100 CONFIG_CRYPTO_DEV_GEODE
101 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/geode-aes.
$(LINUX_KMOD_SUFFIX
)
102 AUTOLOAD
:=$(call AutoLoad
,09,geode-aes
)
105 $(eval
$(call KernelPackage
,crypto-hw-geode
))
108 define KernelPackage
/crypto-hw-hifn-795x
109 SUBMENU
:=$(CRYPTO_MENU
)
110 TITLE
:=HIFN
795x crypto accelerator
111 DEPENDS
:=+kmod-crypto-core
+kmod-crypto-des
114 CONFIG_CRYPTO_DEV_HIFN_795X \
115 CONFIG_CRYPTO_DEV_HIFN_795X_RNG
=y
116 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/hifn_795x.
$(LINUX_KMOD_SUFFIX
)
117 AUTOLOAD
:=$(call AutoLoad
,09,hifn_795x
)
120 $(eval
$(call KernelPackage
,crypto-hw-hifn-795x
))
123 define KernelPackage
/crypto-hw-ixp4xx
124 SUBMENU
:=$(CRYPTO_MENU
)
125 TITLE
:=Intel IXP4xx hardware crypto module
127 @TARGET_ixp4xx
+kmod-crypto-core
+kmod-crypto-des
+kmod-crypto-authenc
130 CONFIG_CRYPTO_DEV_IXP4XX
131 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/ixp4xx_crypto.
$(LINUX_KMOD_SUFFIX
)
132 AUTOLOAD
:=$(call AutoLoad
,90,ixp4xx_crypto
)
135 define KernelPackage
/crypto-hw-ixp4xx
/description
136 Kernel support for the Intel IXP4xx HW crypto engine.
139 $(eval
$(call KernelPackage
,crypto-hw-ixp4xx
))
142 define KernelPackage
/crypto-hw-ppc4xx
143 SUBMENU
:=$(CRYPTO_MENU
)
144 TITLE
:=AMCC PPC4xx hardware crypto module
146 @TARGET_ppc40x||TARGET_ppc44x
+kmod-crypto-core
149 CONFIG_CRYPTO_DEV_PPC4XX
150 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/amcc
/crypto4xx.
$(LINUX_KMOD_SUFFIX
)
151 AUTOLOAD
:=$(call AutoLoad
,90,crypto4xx
)
154 define KernelPackage
/crypto-hw-ppc4xx
/description
155 Kernel support for the AMCC PPC4xx HW crypto engine.
158 $(eval
$(call KernelPackage
,crypto-hw-ppc4xx
))
161 define KernelPackage
/crypto-aes
162 SUBMENU
:=$(CRYPTO_MENU
)
163 TITLE
:=AES cipher CryptoAPI module
164 DEPENDS
:=+kmod-crypto-core
165 KCONFIG
:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
166 FILES
:=$(LINUX_DIR
)/crypto
/aes
$(AES_SUFFIX
).
$(LINUX_KMOD_SUFFIX
)
167 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
))
170 define KernelPackage
/crypto-aes
/x86-2.6
171 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/aes-i586.
$(LINUX_KMOD_SUFFIX
)
172 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
) aes-i586
)
175 $(eval
$(call KernelPackage
,crypto-aes
))
178 define KernelPackage
/crypto-arc4
179 SUBMENU
:=$(CRYPTO_MENU
)
180 TITLE
:=ARC4
(RC4
) cipher CryptoAPI module
181 DEPENDS
:=+kmod-crypto-core
182 KCONFIG
:=CONFIG_CRYPTO_ARC4
183 FILES
:=$(LINUX_DIR
)/crypto
/arc4.
$(LINUX_KMOD_SUFFIX
)
184 AUTOLOAD
:=$(call AutoLoad
,09,arc4
)
187 $(eval
$(call KernelPackage
,crypto-arc4
))
190 define KernelPackage
/crypto-authenc
191 SUBMENU
:=$(CRYPTO_MENU
)
192 TITLE
:=Combined mode wrapper for IPsec
193 DEPENDS
:=+kmod-crypto-core
194 KCONFIG
:=CONFIG_CRYPTO_AUTHENC
195 FILES
:=$(LINUX_DIR
)/crypto
/authenc.
$(LINUX_KMOD_SUFFIX
)
196 AUTOLOAD
:=$(call AutoLoad
,09,authenc
)
199 $(eval
$(call KernelPackage
,crypto-authenc
))
201 define KernelPackage
/crypto-des
202 SUBMENU
:=$(CRYPTO_MENU
)
203 TITLE
:=DES
/3DES cipher CryptoAPI module
204 DEPENDS
:=+kmod-crypto-core
205 KCONFIG
:=CONFIG_CRYPTO_DES
206 FILES
:=$(LINUX_DIR
)/crypto
/des
$(DES_SUFFIX
).
$(LINUX_KMOD_SUFFIX
)
207 AUTOLOAD
:=$(call AutoLoad
,09,des
$(DES_SUFFIX
))
210 $(eval
$(call KernelPackage
,crypto-des
))
213 define KernelPackage
/crypto-hmac
214 SUBMENU
:=$(CRYPTO_MENU
)
215 TITLE
:=HMAC digest CryptoAPI module
216 DEPENDS
:=+kmod-crypto-core
217 KCONFIG
:=CONFIG_CRYPTO_HMAC
218 FILES
:=$(LINUX_DIR
)/crypto
/hmac.
$(LINUX_KMOD_SUFFIX
)
219 AUTOLOAD
:=$(call AutoLoad
,09,hmac
)
222 $(eval
$(call KernelPackage
,crypto-hmac
))
225 define KernelPackage
/crypto-md5
226 SUBMENU
:=$(CRYPTO_MENU
)
227 TITLE
:=MD5 digest CryptoAPI module
228 DEPENDS
:=+kmod-crypto-core
229 KCONFIG
:=CONFIG_CRYPTO_MD5
230 FILES
:=$(LINUX_DIR
)/crypto
/md5.
$(LINUX_KMOD_SUFFIX
)
231 AUTOLOAD
:=$(call AutoLoad
,09,md5
)
234 $(eval
$(call KernelPackage
,crypto-md5
))
237 define KernelPackage
/crypto-michael-mic
238 SUBMENU
:=$(CRYPTO_MENU
)
239 TITLE
:=Michael MIC keyed digest CryptoAPI module
240 DEPENDS
:=+kmod-crypto-core
241 KCONFIG
:=CONFIG_CRYPTO_MICHAEL_MIC
242 FILES
:=$(LINUX_DIR
)/crypto
/michael_mic.
$(LINUX_KMOD_SUFFIX
)
243 AUTOLOAD
:=$(call AutoLoad
,09,michael_mic
)
246 $(eval
$(call KernelPackage
,crypto-michael-mic
))
249 define KernelPackage
/crypto-sha1
250 SUBMENU
:=$(CRYPTO_MENU
)
251 TITLE
:=SHA1 digest CryptoAPI module
252 DEPENDS
:=+kmod-crypto-core
253 KCONFIG
:=CONFIG_CRYPTO_SHA1
254 FILES
:=$(LINUX_DIR
)/crypto
/sha1
$(SHA1_SUFFIX
).
$(LINUX_KMOD_SUFFIX
)
255 AUTOLOAD
:=$(call AutoLoad
,09,sha1
$(SHA1_SUFFIX
))
258 $(eval
$(call KernelPackage
,crypto-sha1
))
261 define KernelPackage
/crypto-misc
262 SUBMENU
:=$(CRYPTO_MENU
)
263 TITLE
:=Other CryptoAPI modules
264 DEPENDS
:=+kmod-crypto-core
266 CONFIG_CRYPTO_ANUBIS \
267 CONFIG_CRYPTO_BLOWFISH \
268 CONFIG_CRYPTO_CAMELLIA \
269 CONFIG_CRYPTO_CAST5 \
270 CONFIG_CRYPTO_CAST6 \
271 CONFIG_CRYPTO_CRC32C \
272 CONFIG_CRYPTO_FCRYPT \
273 CONFIG_CRYPTO_KHAZAD \
275 CONFIG_CRYPTO_SERPENT \
276 CONFIG_CRYPTO_SHA256 \
277 CONFIG_CRYPTO_SHA512 \
279 CONFIG_CRYPTO_TGR192 \
280 CONFIG_CRYPTO_TWOFISH \
281 CONFIG_CRYPTO_TWOFISH_586 \
284 $(LINUX_DIR
)/crypto
/anubis.
$(LINUX_KMOD_SUFFIX
) \
285 $(LINUX_DIR
)/crypto
/blowfish.
$(LINUX_KMOD_SUFFIX
) \
286 $(LINUX_DIR
)/crypto
/cast5.
$(LINUX_KMOD_SUFFIX
) \
287 $(LINUX_DIR
)/crypto
/cast6.
$(LINUX_KMOD_SUFFIX
) \
288 $(LINUX_DIR
)/crypto
/khazad.
$(LINUX_KMOD_SUFFIX
) \
289 $(LINUX_DIR
)/crypto
/md4.
$(LINUX_KMOD_SUFFIX
) \
290 $(LINUX_DIR
)/crypto
/serpent.
$(LINUX_KMOD_SUFFIX
) \
291 $(LINUX_DIR
)/crypto
/sha256
$(SHA256_SUFFIX
).
$(LINUX_KMOD_SUFFIX
) \
292 $(LINUX_DIR
)/crypto
/sha512
$(SHA512_SUFFIX
).
$(LINUX_KMOD_SUFFIX
) \
293 $(LINUX_DIR
)/crypto
/tea.
$(LINUX_KMOD_SUFFIX
) \
294 $(LINUX_DIR
)/crypto
/twofish.
$(LINUX_KMOD_SUFFIX
) \
295 $(LINUX_DIR
)/crypto
/wp512.
$(LINUX_KMOD_SUFFIX
)
298 define KernelPackage
/crypto-misc
/2.6
300 $(LINUX_DIR
)/crypto
/camellia.
$(LINUX_KMOD_SUFFIX
) \
301 $(LINUX_DIR
)/crypto
/crc32c.
$(LINUX_KMOD_SUFFIX
) \
302 $(LINUX_DIR
)/crypto
/fcrypt.
$(LINUX_KMOD_SUFFIX
) \
303 $(LINUX_DIR
)/crypto
/tgr192.
$(LINUX_KMOD_SUFFIX
)
306 $(eval
$(call KernelPackage
,crypto-misc
))
308 define KernelPackage
/crypto-ocf
309 SUBMENU
:=$(CRYPTO_MENU
)
311 DEPENDS
:=+kmod-crypto-core @
!TARGET_uml
314 CONFIG_OCF_CRYPTODEV \
315 CONFIG_OCF_CRYPTOSOFT \
317 CONFIG_OCF_RANDOMHARVEST
=y
319 $(LINUX_DIR
)/crypto
/ocf
/ocf.
$(LINUX_KMOD_SUFFIX
) \
320 $(LINUX_DIR
)/crypto
/ocf
/cryptodev.
$(LINUX_KMOD_SUFFIX
) \
321 $(LINUX_DIR
)/crypto
/ocf
/cryptosoft.
$(LINUX_KMOD_SUFFIX
)
322 AUTOLOAD
:=$(call AutoLoad
,09, \
329 $(eval
$(call KernelPackage
,crypto-ocf
))
332 define KernelPackage
/crypto-null
333 SUBMENU
:=$(CRYPTO_MENU
)
334 TITLE
:=Null CryptoAPI module
335 DEPENDS
:=+kmod-crypto-core
336 KCONFIG
:=CONFIG_CRYPTO_NULL
337 FILES
:=$(LINUX_DIR
)/crypto
/crypto_null.
$(LINUX_KMOD_SUFFIX
)
338 AUTOLOAD
:=$(call AutoLoad
,09,crypto_null
)
341 $(eval
$(call KernelPackage
,crypto-null
))
344 define KernelPackage
/crypto-test
345 SUBMENU
:=$(CRYPTO_MENU
)
346 TITLE
:=Test CryptoAPI module
347 DEPENDS
:=+kmod-crypto-core
348 KCONFIG
:=CONFIG_CRYPTO_TEST
349 FILES
:=$(LINUX_DIR
)/crypto
/tcrypt.
$(LINUX_KMOD_SUFFIX
)
352 $(eval
$(call KernelPackage
,crypto-test
))