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)
31 ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.30)),1)
32 CRYPTO_MODULE_PCOMPRESS:=PCOMP=pcompress
36 ALGAPI=crypto_algapi \
38 $(CRYPTO_MODULE_PCOMPRESS) \
39 BLKCIPHER=$(BLKCIPHER_PREFIX)blkcipher \
46 crypto_confvar=CONFIG_CRYPTO_$(word 1,$(subst =,$(space),$(1)))
47 crypto_file=$(if $(findstring y,$($(call crypto_confvar,$(1)))),,$(LINUX_DIR)/crypto/$(word 2,$(subst =,$(space),$(1))).$(LINUX_KMOD_SUFFIX))
48 crypto_name=$(if $(findstring y,$($(call crypto_confvar,$(1)))),,$(word 2,$(subst =,$(space),$(1))))
50 # XXX: added CONFIG_CRYPTO_HMAC to KCONFIG so that CONFIG_CRYPTO_HASH is
51 # always set, even if no hash modules are selected
52 define KernelPackage/crypto-core
53 SUBMENU:=$(CRYPTO_MENU)
54 TITLE:=Core CryptoAPI modules
55 KCONFIG:=CONFIG_CRYPTO=y CONFIG_CRYPTO_HMAC $(foreach mod,$(CRYPTO_MODULES),$(call crypto_confvar,$(mod)))
56 FILES:=$(foreach mod,$(CRYPTO_MODULES),$(call crypto_file,$(mod)))
57 AUTOLOAD:=$(call AutoLoad,01,$(foreach mod,$(CRYPTO_MODULES),$(call crypto_name,$(mod))))
60 define KernelPackage/crypto-core/2.4
61 FILES:=$(LINUX_DIR)/crypto/deflate.$(LINUX_KMOD_SUFFIX)
62 AUTOLOAD:=$(call AutoLoad,01, deflate)
65 $(eval $(call KernelPackage,crypto-core))
68 define KernelPackage/crypto-hw-padlock
69 SUBMENU:=$(CRYPTO_MENU)
70 TITLE:=VIA PadLock ACE with AES/SHA hw crypto module
71 DEPENDS:=+kmod-crypto-core
74 CONFIG_CRYPTO_DEV_PADLOCK \
75 CONFIG_CRYPTO_DEV_PADLOCK_AES \
76 CONFIG_CRYPTO_DEV_PADLOCK_SHA
78 $(LINUX_DIR)/drivers/crypto/padlock-aes.$(LINUX_KMOD_SUFFIX) \
79 $(LINUX_DIR)/drivers/crypto/padlock-sha.$(LINUX_KMOD_SUFFIX)
80 AUTOLOAD:=$(call AutoLoad,09,padlock-aes padlock-sha)
83 $(eval $(call KernelPackage,crypto-hw-padlock))
86 define KernelPackage/crypto-hw-geode
87 SUBMENU:=$(CRYPTO_MENU)
88 TITLE:=AMD Geode hardware crypto module
89 DEPENDS:=+kmod-crypto-core
92 CONFIG_CRYPTO_DEV_GEODE
93 FILES:=$(LINUX_DIR)/drivers/crypto/geode-aes.$(LINUX_KMOD_SUFFIX)
94 AUTOLOAD:=$(call AutoLoad,09,geode-aes)
97 $(eval $(call KernelPackage,crypto-hw-geode))
100 define KernelPackage/crypto-hw-hifn-795x
101 SUBMENU:=$(CRYPTO_MENU)
102 TITLE:=HIFN 795x crypto accelerator
103 DEPENDS:=+kmod-crypto-core +kmod-crypto-des
106 CONFIG_CRYPTO_DEV_HIFN_795X \
107 CONFIG_CRYPTO_DEV_HIFN_795X_RNG=y
108 FILES:=$(LINUX_DIR)/drivers/crypto/hifn_795x.$(LINUX_KMOD_SUFFIX)
109 AUTOLOAD:=$(call AutoLoad,09,hifn_795x)
112 $(eval $(call KernelPackage,crypto-hw-hifn-795x))
115 define KernelPackage/crypto-hw-ixp4xx
116 SUBMENU:=$(CRYPTO_MENU)
117 TITLE:=Intel IXP4xx hardware crypto module
119 @TARGET_ixp4xx +kmod-crypto-core +kmod-crypto-des +kmod-crypto-authenc
120 KCONFIG:= CONFIG_CRYPTO_DEV_IXP4XX
121 FILES:=$(LINUX_DIR)/drivers/crypto/ixp4xx_crypto.$(LINUX_KMOD_SUFFIX)
122 AUTOLOAD:=$(call AutoLoad,90,ixp4xx_crypto)
125 define KernelPackage/crypto-hw-ixp4xx/description
126 Kernel support for the Intel IXP4xx HW crypto engine.
129 $(eval $(call KernelPackage,crypto-hw-ixp4xx))
132 define KernelPackage/crypto-aes
133 SUBMENU:=$(CRYPTO_MENU)
134 TITLE:=AES cipher CryptoAPI module
135 DEPENDS:=+kmod-crypto-core
136 KCONFIG:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
137 FILES:=$(LINUX_DIR)/crypto/aes$(AES_SUFFIX).$(LINUX_KMOD_SUFFIX)
138 AUTOLOAD:=$(call AutoLoad,09,aes$(AES_SUFFIX))
141 define KernelPackage/crypto-aes/x86-2.6
142 FILES+=$(LINUX_DIR)/arch/x86/crypto/aes-i586.$(LINUX_KMOD_SUFFIX)
143 AUTOLOAD:=$(call AutoLoad,09,aes$(AES_SUFFIX) aes-i586)
146 $(eval $(call KernelPackage,crypto-aes))
149 define KernelPackage/crypto-arc4
150 SUBMENU:=$(CRYPTO_MENU)
151 TITLE:=ARC4 (RC4) cipher CryptoAPI module
152 DEPENDS:=+kmod-crypto-core
153 KCONFIG:=CONFIG_CRYPTO_ARC4
154 FILES:=$(LINUX_DIR)/crypto/arc4.$(LINUX_KMOD_SUFFIX)
155 AUTOLOAD:=$(call AutoLoad,09,arc4)
158 $(eval $(call KernelPackage,crypto-arc4))
161 define KernelPackage/crypto-authenc
162 SUBMENU:=$(CRYPTO_MENU)
163 TITLE:=Combined mode wrapper for IPsec
164 DEPENDS:=+kmod-crypto-core
165 KCONFIG:=CONFIG_CRYPTO_AUTHENC
166 FILES:=$(LINUX_DIR)/crypto/authenc.$(LINUX_KMOD_SUFFIX)
167 AUTOLOAD:=$(call AutoLoad,09,authenc)
170 $(eval $(call KernelPackage,crypto-authenc))
172 define KernelPackage/crypto-des
173 SUBMENU:=$(CRYPTO_MENU)
174 TITLE:=DES/3DES cipher CryptoAPI module
175 DEPENDS:=+kmod-crypto-core
176 KCONFIG:=CONFIG_CRYPTO_DES
177 FILES:=$(LINUX_DIR)/crypto/des$(DES_SUFFIX).$(LINUX_KMOD_SUFFIX)
178 AUTOLOAD:=$(call AutoLoad,09,des$(DES_SUFFIX))
181 $(eval $(call KernelPackage,crypto-des))
184 define KernelPackage/crypto-hmac
185 SUBMENU:=$(CRYPTO_MENU)
186 TITLE:=HMAC digest CryptoAPI module
187 DEPENDS:=+kmod-crypto-core
188 KCONFIG:=CONFIG_CRYPTO_HMAC
189 FILES:=$(LINUX_DIR)/crypto/hmac.$(LINUX_KMOD_SUFFIX)
190 AUTOLOAD:=$(call AutoLoad,09,hmac)
193 $(eval $(call KernelPackage,crypto-hmac))
196 define KernelPackage/crypto-md5
197 SUBMENU:=$(CRYPTO_MENU)
198 TITLE:=MD5 digest CryptoAPI module
199 DEPENDS:=+kmod-crypto-core
200 KCONFIG:=CONFIG_CRYPTO_MD5
201 FILES:=$(LINUX_DIR)/crypto/md5.$(LINUX_KMOD_SUFFIX)
202 AUTOLOAD:=$(call AutoLoad,09,md5)
205 $(eval $(call KernelPackage,crypto-md5))
208 define KernelPackage/crypto-michael-mic
209 SUBMENU:=$(CRYPTO_MENU)
210 TITLE:=Michael MIC keyed digest CryptoAPI module
211 DEPENDS:=+kmod-crypto-core
212 KCONFIG:=CONFIG_CRYPTO_MICHAEL_MIC
213 FILES:=$(LINUX_DIR)/crypto/michael_mic.$(LINUX_KMOD_SUFFIX)
214 AUTOLOAD:=$(call AutoLoad,09,michael_mic)
217 $(eval $(call KernelPackage,crypto-michael-mic))
220 define KernelPackage/crypto-sha1
221 SUBMENU:=$(CRYPTO_MENU)
222 TITLE:=SHA1 digest CryptoAPI module
223 DEPENDS:=+kmod-crypto-core
224 KCONFIG:=CONFIG_CRYPTO_SHA1
225 FILES:=$(LINUX_DIR)/crypto/sha1$(SHA1_SUFFIX).$(LINUX_KMOD_SUFFIX)
226 AUTOLOAD:=$(call AutoLoad,09,sha1$(SHA1_SUFFIX))
229 $(eval $(call KernelPackage,crypto-sha1))
232 define KernelPackage/crypto-misc
233 SUBMENU:=$(CRYPTO_MENU)
234 TITLE:=Other CryptoAPI modules
235 DEPENDS:=+kmod-crypto-core
237 CONFIG_CRYPTO_ANUBIS \
238 CONFIG_CRYPTO_BLOWFISH \
239 CONFIG_CRYPTO_CAMELLIA \
240 CONFIG_CRYPTO_CAST5 \
241 CONFIG_CRYPTO_CAST6 \
242 CONFIG_CRYPTO_CRC32C \
243 CONFIG_CRYPTO_FCRYPT \
244 CONFIG_CRYPTO_KHAZAD \
246 CONFIG_CRYPTO_SERPENT \
247 CONFIG_CRYPTO_SHA256 \
248 CONFIG_CRYPTO_SHA512 \
250 CONFIG_CRYPTO_TGR192 \
251 CONFIG_CRYPTO_TWOFISH \
252 CONFIG_CRYPTO_TWOFISH_586 \
255 $(LINUX_DIR)/crypto/anubis.$(LINUX_KMOD_SUFFIX) \
256 $(LINUX_DIR)/crypto/blowfish.$(LINUX_KMOD_SUFFIX) \
257 $(LINUX_DIR)/crypto/cast5.$(LINUX_KMOD_SUFFIX) \
258 $(LINUX_DIR)/crypto/cast6.$(LINUX_KMOD_SUFFIX) \
259 $(LINUX_DIR)/crypto/khazad.$(LINUX_KMOD_SUFFIX) \
260 $(LINUX_DIR)/crypto/md4.$(LINUX_KMOD_SUFFIX) \
261 $(LINUX_DIR)/crypto/serpent.$(LINUX_KMOD_SUFFIX) \
262 $(LINUX_DIR)/crypto/sha256$(SHA256_SUFFIX).$(LINUX_KMOD_SUFFIX) \
263 $(LINUX_DIR)/crypto/sha512$(SHA512_SUFFIX).$(LINUX_KMOD_SUFFIX) \
264 $(LINUX_DIR)/crypto/tea.$(LINUX_KMOD_SUFFIX) \
265 $(LINUX_DIR)/crypto/twofish.$(LINUX_KMOD_SUFFIX) \
266 $(LINUX_DIR)/crypto/wp512.$(LINUX_KMOD_SUFFIX)
269 define KernelPackage/crypto-misc/2.6
271 $(LINUX_DIR)/crypto/camellia.$(LINUX_KMOD_SUFFIX) \
272 $(LINUX_DIR)/crypto/crc32c.$(LINUX_KMOD_SUFFIX) \
273 $(LINUX_DIR)/crypto/fcrypt.$(LINUX_KMOD_SUFFIX) \
274 $(LINUX_DIR)/crypto/tgr192.$(LINUX_KMOD_SUFFIX)
277 $(eval $(call KernelPackage,crypto-misc))
279 define KernelPackage/crypto-ocf
280 SUBMENU:=$(CRYPTO_MENU)
282 DEPENDS:=+kmod-crypto-core @!TARGET_uml
285 CONFIG_OCF_CRYPTODEV \
286 CONFIG_OCF_CRYPTOSOFT \
288 CONFIG_OCF_RANDOMHARVEST=y
290 $(LINUX_DIR)/crypto/ocf/ocf.$(LINUX_KMOD_SUFFIX) \
291 $(LINUX_DIR)/crypto/ocf/cryptodev.$(LINUX_KMOD_SUFFIX) \
292 $(LINUX_DIR)/crypto/ocf/cryptosoft.$(LINUX_KMOD_SUFFIX)
293 AUTOLOAD:=$(call AutoLoad,09, \
300 $(eval $(call KernelPackage,crypto-ocf))
303 define KernelPackage/crypto-null
304 SUBMENU:=$(CRYPTO_MENU)
305 TITLE:=Null CryptoAPI module
306 DEPENDS:=+kmod-crypto-core
307 KCONFIG:=CONFIG_CRYPTO_NULL
308 FILES:=$(LINUX_DIR)/crypto/crypto_null.$(LINUX_KMOD_SUFFIX)
309 AUTOLOAD:=$(call AutoLoad,09,crypto_null)
312 $(eval $(call KernelPackage,crypto-null))
315 define KernelPackage/crypto-test
316 SUBMENU:=$(CRYPTO_MENU)
317 TITLE:=Test CryptoAPI module
318 DEPENDS:=+kmod-crypto-core
319 KCONFIG:=CONFIG_CRYPTO_TEST
320 FILES:=$(LINUX_DIR)/crypto/tcrypt.$(LINUX_KMOD_SUFFIX)
323 $(eval $(call KernelPackage,crypto-test))