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 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
)
23 ifeq ($(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),ge
,2.6.25)),1)
24 CRYPTO_PREFIX
:=crypto_
25 BLKCIPHER_PREFIX
:=$(CRYPTO_PREFIX
)
29 BLKCIPHER_CONF
:=BLKCIPHER
31 ifeq ($(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),ge
,2.6.30)),1)
32 CRYPTO_MODULE_PCOMPRESS
:=PCOMP
=pcompress
34 MANAGER_CONF
:=MANAGER2
35 BLKCIPHER_CONF
:=BLKCIPHER2
40 ALGAPI
=crypto_algapi \
42 $(CRYPTO_MODULE_PCOMPRESS
) \
43 $(BLKCIPHER_CONF
)=$(BLKCIPHER_PREFIX
)blkcipher \
44 $(HASH_CONF
)=crypto_hash \
45 $(MANAGER_CONF
)=cryptomgr \
50 crypto_confvar
=CONFIG_CRYPTO_
$(word 1,$(subst =,$(space
),$(1)))
51 crypto_file
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(LINUX_DIR
)/crypto
/$(word 2,$(subst =,$(space
),$(1))).
$(LINUX_KMOD_SUFFIX
))
52 crypto_name
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(word 2,$(subst =,$(space
),$(1))))
54 # XXX: added CONFIG_CRYPTO_HMAC to KCONFIG so that CONFIG_CRYPTO_HASH is
55 # always set, even if no hash modules are selected
56 define KernelPackage
/crypto-core
57 SUBMENU
:=$(CRYPTO_MENU
)
58 TITLE
:=Core CryptoAPI modules
59 KCONFIG
:=CONFIG_CRYPTO
=y CONFIG_CRYPTO_HMAC
$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_confvar
,$(mod
)))
60 FILES
:=$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_file
,$(mod
)))
61 AUTOLOAD
:=$(call AutoLoad
,01,$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_name
,$(mod
))))
64 define KernelPackage
/crypto-core
/2.4
65 FILES
:=$(LINUX_DIR
)/crypto
/deflate.
$(LINUX_KMOD_SUFFIX
)
66 AUTOLOAD
:=$(call AutoLoad
,01, deflate
)
69 $(eval
$(call KernelPackage
,crypto-core
))
72 define KernelPackage
/crypto-hw-padlock
73 SUBMENU
:=$(CRYPTO_MENU
)
74 TITLE
:=VIA PadLock ACE with AES
/SHA hw crypto module
75 DEPENDS
:=+kmod-crypto-core
78 CONFIG_CRYPTO_DEV_PADLOCK \
79 CONFIG_CRYPTO_DEV_PADLOCK_AES \
80 CONFIG_CRYPTO_DEV_PADLOCK_SHA
82 $(LINUX_DIR
)/drivers
/crypto
/padlock-aes.
$(LINUX_KMOD_SUFFIX
) \
83 $(LINUX_DIR
)/drivers
/crypto
/padlock-sha.
$(LINUX_KMOD_SUFFIX
)
84 AUTOLOAD
:=$(call AutoLoad
,09,padlock-aes padlock-sha
)
87 $(eval
$(call KernelPackage
,crypto-hw-padlock
))
90 define KernelPackage
/crypto-hw-geode
91 SUBMENU
:=$(CRYPTO_MENU
)
92 TITLE
:=AMD Geode hardware crypto module
93 DEPENDS
:=+kmod-crypto-core
96 CONFIG_CRYPTO_DEV_GEODE
97 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/geode-aes.
$(LINUX_KMOD_SUFFIX
)
98 AUTOLOAD
:=$(call AutoLoad
,09,geode-aes
)
101 $(eval
$(call KernelPackage
,crypto-hw-geode
))
104 define KernelPackage
/crypto-hw-hifn-795x
105 SUBMENU
:=$(CRYPTO_MENU
)
106 TITLE
:=HIFN
795x crypto accelerator
107 DEPENDS
:=+kmod-crypto-core
+kmod-crypto-des @
!TARGET_ubicom32
110 CONFIG_CRYPTO_DEV_HIFN_795X \
111 CONFIG_CRYPTO_DEV_HIFN_795X_RNG
=y
112 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/hifn_795x.
$(LINUX_KMOD_SUFFIX
)
113 AUTOLOAD
:=$(call AutoLoad
,09,hifn_795x
)
116 $(eval
$(call KernelPackage
,crypto-hw-hifn-795x
))
119 define KernelPackage
/crypto-hw-ixp4xx
120 SUBMENU
:=$(CRYPTO_MENU
)
121 TITLE
:=Intel IXP4xx hardware crypto module
123 @TARGET_ixp4xx
+kmod-crypto-core
+kmod-crypto-des
+kmod-crypto-authenc
126 CONFIG_CRYPTO_DEV_IXP4XX
127 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/ixp4xx_crypto.
$(LINUX_KMOD_SUFFIX
)
128 AUTOLOAD
:=$(call AutoLoad
,90,ixp4xx_crypto
)
131 define KernelPackage
/crypto-hw-ixp4xx
/description
132 Kernel support for the Intel IXP4xx HW crypto engine.
135 $(eval
$(call KernelPackage
,crypto-hw-ixp4xx
))
138 define KernelPackage
/crypto-hw-ppc4xx
139 SUBMENU
:=$(CRYPTO_MENU
)
140 TITLE
:=AMCC PPC4xx hardware crypto module
142 @TARGET_ppc40x||TARGET_ppc44x
+kmod-crypto-core
145 CONFIG_CRYPTO_DEV_PPC4XX
146 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/amcc
/crypto4xx.
$(LINUX_KMOD_SUFFIX
)
147 AUTOLOAD
:=$(call AutoLoad
,90,crypto4xx
)
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 SUBMENU
:=$(CRYPTO_MENU
)
159 TITLE
:=AES cipher CryptoAPI module
160 DEPENDS
:=+kmod-crypto-core
161 KCONFIG
:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
162 FILES
:=$(LINUX_DIR
)/crypto
/aes
$(AES_SUFFIX
).
$(LINUX_KMOD_SUFFIX
)
163 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
))
166 define KernelPackage
/crypto-aes
/x86-2.6
167 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/aes-i586.
$(LINUX_KMOD_SUFFIX
)
168 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
) aes-i586
)
171 $(eval
$(call KernelPackage
,crypto-aes
))
174 define KernelPackage
/crypto-arc4
175 SUBMENU
:=$(CRYPTO_MENU
)
176 TITLE
:=ARC4
(RC4
) cipher CryptoAPI module
177 DEPENDS
:=+kmod-crypto-core
178 KCONFIG
:=CONFIG_CRYPTO_ARC4
179 FILES
:=$(LINUX_DIR
)/crypto
/arc4.
$(LINUX_KMOD_SUFFIX
)
180 AUTOLOAD
:=$(call AutoLoad
,09,arc4
)
183 $(eval
$(call KernelPackage
,crypto-arc4
))
186 define KernelPackage
/crypto-authenc
187 SUBMENU
:=$(CRYPTO_MENU
)
188 TITLE
:=Combined mode wrapper for IPsec
189 DEPENDS
:=+kmod-crypto-core
190 KCONFIG
:=CONFIG_CRYPTO_AUTHENC
191 FILES
:=$(LINUX_DIR
)/crypto
/authenc.
$(LINUX_KMOD_SUFFIX
)
192 AUTOLOAD
:=$(call AutoLoad
,09,authenc
)
195 $(eval
$(call KernelPackage
,crypto-authenc
))
197 define KernelPackage
/crypto-des
198 SUBMENU
:=$(CRYPTO_MENU
)
199 TITLE
:=DES
/3DES cipher CryptoAPI module
200 DEPENDS
:=+kmod-crypto-core
201 KCONFIG
:=CONFIG_CRYPTO_DES
202 FILES
:=$(LINUX_DIR
)/crypto
/des
$(DES_SUFFIX
).
$(LINUX_KMOD_SUFFIX
)
203 AUTOLOAD
:=$(call AutoLoad
,09,des
$(DES_SUFFIX
))
206 $(eval
$(call KernelPackage
,crypto-des
))
209 define KernelPackage
/crypto-hmac
210 SUBMENU
:=$(CRYPTO_MENU
)
211 TITLE
:=HMAC digest CryptoAPI module
212 DEPENDS
:=+kmod-crypto-core
213 KCONFIG
:=CONFIG_CRYPTO_HMAC
214 FILES
:=$(LINUX_DIR
)/crypto
/hmac.
$(LINUX_KMOD_SUFFIX
)
215 AUTOLOAD
:=$(call AutoLoad
,09,hmac
)
218 $(eval
$(call KernelPackage
,crypto-hmac
))
221 define KernelPackage
/crypto-md5
222 SUBMENU
:=$(CRYPTO_MENU
)
223 TITLE
:=MD5 digest CryptoAPI module
224 DEPENDS
:=+kmod-crypto-core
225 KCONFIG
:=CONFIG_CRYPTO_MD5
226 FILES
:=$(LINUX_DIR
)/crypto
/md5.
$(LINUX_KMOD_SUFFIX
)
227 AUTOLOAD
:=$(call AutoLoad
,09,md5
)
230 $(eval
$(call KernelPackage
,crypto-md5
))
233 define KernelPackage
/crypto-michael-mic
234 SUBMENU
:=$(CRYPTO_MENU
)
235 TITLE
:=Michael MIC keyed digest CryptoAPI module
236 DEPENDS
:=+kmod-crypto-core
237 KCONFIG
:=CONFIG_CRYPTO_MICHAEL_MIC
238 FILES
:=$(LINUX_DIR
)/crypto
/michael_mic.
$(LINUX_KMOD_SUFFIX
)
239 AUTOLOAD
:=$(call AutoLoad
,09,michael_mic
)
242 $(eval
$(call KernelPackage
,crypto-michael-mic
))
245 define KernelPackage
/crypto-sha1
246 SUBMENU
:=$(CRYPTO_MENU
)
247 TITLE
:=SHA1 digest CryptoAPI module
248 DEPENDS
:=+kmod-crypto-core
249 KCONFIG
:=CONFIG_CRYPTO_SHA1
250 FILES
:=$(LINUX_DIR
)/crypto
/sha1
$(SHA1_SUFFIX
).
$(LINUX_KMOD_SUFFIX
)
251 AUTOLOAD
:=$(call AutoLoad
,09,sha1
$(SHA1_SUFFIX
))
254 $(eval
$(call KernelPackage
,crypto-sha1
))
257 define KernelPackage
/crypto-misc
258 SUBMENU
:=$(CRYPTO_MENU
)
259 TITLE
:=Other CryptoAPI modules
260 DEPENDS
:=+kmod-crypto-core
262 CONFIG_CRYPTO_ANUBIS \
263 CONFIG_CRYPTO_BLOWFISH \
264 CONFIG_CRYPTO_CAMELLIA \
265 CONFIG_CRYPTO_CAST5 \
266 CONFIG_CRYPTO_CAST6 \
267 CONFIG_CRYPTO_CRC32C \
268 CONFIG_CRYPTO_FCRYPT \
269 CONFIG_CRYPTO_KHAZAD \
271 CONFIG_CRYPTO_SERPENT \
272 CONFIG_CRYPTO_SHA256 \
273 CONFIG_CRYPTO_SHA512 \
275 CONFIG_CRYPTO_TGR192 \
276 CONFIG_CRYPTO_TWOFISH \
277 CONFIG_CRYPTO_TWOFISH_586 \
280 $(LINUX_DIR
)/crypto
/anubis.
$(LINUX_KMOD_SUFFIX
) \
281 $(LINUX_DIR
)/crypto
/blowfish.
$(LINUX_KMOD_SUFFIX
) \
282 $(LINUX_DIR
)/crypto
/cast5.
$(LINUX_KMOD_SUFFIX
) \
283 $(LINUX_DIR
)/crypto
/cast6.
$(LINUX_KMOD_SUFFIX
) \
284 $(LINUX_DIR
)/crypto
/khazad.
$(LINUX_KMOD_SUFFIX
) \
285 $(LINUX_DIR
)/crypto
/md4.
$(LINUX_KMOD_SUFFIX
) \
286 $(LINUX_DIR
)/crypto
/serpent.
$(LINUX_KMOD_SUFFIX
) \
287 $(LINUX_DIR
)/crypto
/sha256
$(SHA256_SUFFIX
).
$(LINUX_KMOD_SUFFIX
) \
288 $(LINUX_DIR
)/crypto
/sha512
$(SHA512_SUFFIX
).
$(LINUX_KMOD_SUFFIX
) \
289 $(LINUX_DIR
)/crypto
/tea.
$(LINUX_KMOD_SUFFIX
) \
290 $(LINUX_DIR
)/crypto
/twofish.
$(LINUX_KMOD_SUFFIX
) \
291 $(LINUX_DIR
)/crypto
/wp512.
$(LINUX_KMOD_SUFFIX
)
294 define KernelPackage
/crypto-misc
/2.6
296 $(LINUX_DIR
)/crypto
/camellia.
$(LINUX_KMOD_SUFFIX
) \
297 $(LINUX_DIR
)/crypto
/crc32c.
$(LINUX_KMOD_SUFFIX
) \
298 $(LINUX_DIR
)/crypto
/fcrypt.
$(LINUX_KMOD_SUFFIX
) \
299 $(LINUX_DIR
)/crypto
/tgr192.
$(LINUX_KMOD_SUFFIX
)
302 $(eval
$(call KernelPackage
,crypto-misc
))
304 define KernelPackage
/crypto-ocf
305 SUBMENU
:=$(CRYPTO_MENU
)
307 DEPENDS
:=+kmod-crypto-core @
!TARGET_uml
310 CONFIG_OCF_CRYPTODEV \
311 CONFIG_OCF_CRYPTOSOFT \
313 CONFIG_OCF_RANDOMHARVEST
=y
315 $(LINUX_DIR
)/crypto
/ocf
/ocf.
$(LINUX_KMOD_SUFFIX
) \
316 $(LINUX_DIR
)/crypto
/ocf
/cryptodev.
$(LINUX_KMOD_SUFFIX
) \
317 $(LINUX_DIR
)/crypto
/ocf
/cryptosoft.
$(LINUX_KMOD_SUFFIX
)
318 AUTOLOAD
:=$(call AutoLoad
,09, \
325 $(eval
$(call KernelPackage
,crypto-ocf
))
328 define KernelPackage
/crypto-null
329 SUBMENU
:=$(CRYPTO_MENU
)
330 TITLE
:=Null CryptoAPI module
331 DEPENDS
:=+kmod-crypto-core
332 KCONFIG
:=CONFIG_CRYPTO_NULL
333 FILES
:=$(LINUX_DIR
)/crypto
/crypto_null.
$(LINUX_KMOD_SUFFIX
)
334 AUTOLOAD
:=$(call AutoLoad
,09,crypto_null
)
337 $(eval
$(call KernelPackage
,crypto-null
))
340 define KernelPackage
/crypto-test
341 SUBMENU
:=$(CRYPTO_MENU
)
342 TITLE
:=Test CryptoAPI module
343 DEPENDS
:=+kmod-crypto-core
344 KCONFIG
:=CONFIG_CRYPTO_TEST
345 FILES
:=$(LINUX_DIR
)/crypto
/tcrypt.
$(LINUX_KMOD_SUFFIX
)
348 $(eval
$(call KernelPackage
,crypto-test
))