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
122 CONFIG_CRYPTO_DEV_IXP4XX
123 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/ixp4xx_crypto.
$(LINUX_KMOD_SUFFIX
)
124 AUTOLOAD
:=$(call AutoLoad
,90,ixp4xx_crypto
)
127 define KernelPackage
/crypto-hw-ixp4xx
/description
128 Kernel support for the Intel IXP4xx HW crypto engine.
131 $(eval
$(call KernelPackage
,crypto-hw-ixp4xx
))
134 define KernelPackage
/crypto-aes
135 SUBMENU
:=$(CRYPTO_MENU
)
136 TITLE
:=AES cipher CryptoAPI module
137 DEPENDS
:=+kmod-crypto-core
138 KCONFIG
:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
139 FILES
:=$(LINUX_DIR
)/crypto
/aes
$(AES_SUFFIX
).
$(LINUX_KMOD_SUFFIX
)
140 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
))
143 define KernelPackage
/crypto-aes
/x86-2.6
144 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/aes-i586.
$(LINUX_KMOD_SUFFIX
)
145 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
) aes-i586
)
148 $(eval
$(call KernelPackage
,crypto-aes
))
151 define KernelPackage
/crypto-arc4
152 SUBMENU
:=$(CRYPTO_MENU
)
153 TITLE
:=ARC4
(RC4
) cipher CryptoAPI module
154 DEPENDS
:=+kmod-crypto-core
155 KCONFIG
:=CONFIG_CRYPTO_ARC4
156 FILES
:=$(LINUX_DIR
)/crypto
/arc4.
$(LINUX_KMOD_SUFFIX
)
157 AUTOLOAD
:=$(call AutoLoad
,09,arc4
)
160 $(eval
$(call KernelPackage
,crypto-arc4
))
163 define KernelPackage
/crypto-authenc
164 SUBMENU
:=$(CRYPTO_MENU
)
165 TITLE
:=Combined mode wrapper for IPsec
166 DEPENDS
:=+kmod-crypto-core
167 KCONFIG
:=CONFIG_CRYPTO_AUTHENC
168 FILES
:=$(LINUX_DIR
)/crypto
/authenc.
$(LINUX_KMOD_SUFFIX
)
169 AUTOLOAD
:=$(call AutoLoad
,09,authenc
)
172 $(eval
$(call KernelPackage
,crypto-authenc
))
174 define KernelPackage
/crypto-des
175 SUBMENU
:=$(CRYPTO_MENU
)
176 TITLE
:=DES
/3DES cipher CryptoAPI module
177 DEPENDS
:=+kmod-crypto-core
178 KCONFIG
:=CONFIG_CRYPTO_DES
179 FILES
:=$(LINUX_DIR
)/crypto
/des
$(DES_SUFFIX
).
$(LINUX_KMOD_SUFFIX
)
180 AUTOLOAD
:=$(call AutoLoad
,09,des
$(DES_SUFFIX
))
183 $(eval
$(call KernelPackage
,crypto-des
))
186 define KernelPackage
/crypto-hmac
187 SUBMENU
:=$(CRYPTO_MENU
)
188 TITLE
:=HMAC digest CryptoAPI module
189 DEPENDS
:=+kmod-crypto-core
190 KCONFIG
:=CONFIG_CRYPTO_HMAC
191 FILES
:=$(LINUX_DIR
)/crypto
/hmac.
$(LINUX_KMOD_SUFFIX
)
192 AUTOLOAD
:=$(call AutoLoad
,09,hmac
)
195 $(eval
$(call KernelPackage
,crypto-hmac
))
198 define KernelPackage
/crypto-md5
199 SUBMENU
:=$(CRYPTO_MENU
)
200 TITLE
:=MD5 digest CryptoAPI module
201 DEPENDS
:=+kmod-crypto-core
202 KCONFIG
:=CONFIG_CRYPTO_MD5
203 FILES
:=$(LINUX_DIR
)/crypto
/md5.
$(LINUX_KMOD_SUFFIX
)
204 AUTOLOAD
:=$(call AutoLoad
,09,md5
)
207 $(eval
$(call KernelPackage
,crypto-md5
))
210 define KernelPackage
/crypto-michael-mic
211 SUBMENU
:=$(CRYPTO_MENU
)
212 TITLE
:=Michael MIC keyed digest CryptoAPI module
213 DEPENDS
:=+kmod-crypto-core
214 KCONFIG
:=CONFIG_CRYPTO_MICHAEL_MIC
215 FILES
:=$(LINUX_DIR
)/crypto
/michael_mic.
$(LINUX_KMOD_SUFFIX
)
216 AUTOLOAD
:=$(call AutoLoad
,09,michael_mic
)
219 $(eval
$(call KernelPackage
,crypto-michael-mic
))
222 define KernelPackage
/crypto-sha1
223 SUBMENU
:=$(CRYPTO_MENU
)
224 TITLE
:=SHA1 digest CryptoAPI module
225 DEPENDS
:=+kmod-crypto-core
226 KCONFIG
:=CONFIG_CRYPTO_SHA1
227 FILES
:=$(LINUX_DIR
)/crypto
/sha1
$(SHA1_SUFFIX
).
$(LINUX_KMOD_SUFFIX
)
228 AUTOLOAD
:=$(call AutoLoad
,09,sha1
$(SHA1_SUFFIX
))
231 $(eval
$(call KernelPackage
,crypto-sha1
))
234 define KernelPackage
/crypto-misc
235 SUBMENU
:=$(CRYPTO_MENU
)
236 TITLE
:=Other CryptoAPI modules
237 DEPENDS
:=+kmod-crypto-core
239 CONFIG_CRYPTO_ANUBIS \
240 CONFIG_CRYPTO_BLOWFISH \
241 CONFIG_CRYPTO_CAMELLIA \
242 CONFIG_CRYPTO_CAST5 \
243 CONFIG_CRYPTO_CAST6 \
244 CONFIG_CRYPTO_CRC32C \
245 CONFIG_CRYPTO_FCRYPT \
246 CONFIG_CRYPTO_KHAZAD \
248 CONFIG_CRYPTO_SERPENT \
249 CONFIG_CRYPTO_SHA256 \
250 CONFIG_CRYPTO_SHA512 \
252 CONFIG_CRYPTO_TGR192 \
253 CONFIG_CRYPTO_TWOFISH \
254 CONFIG_CRYPTO_TWOFISH_586 \
257 $(LINUX_DIR
)/crypto
/anubis.
$(LINUX_KMOD_SUFFIX
) \
258 $(LINUX_DIR
)/crypto
/blowfish.
$(LINUX_KMOD_SUFFIX
) \
259 $(LINUX_DIR
)/crypto
/cast5.
$(LINUX_KMOD_SUFFIX
) \
260 $(LINUX_DIR
)/crypto
/cast6.
$(LINUX_KMOD_SUFFIX
) \
261 $(LINUX_DIR
)/crypto
/khazad.
$(LINUX_KMOD_SUFFIX
) \
262 $(LINUX_DIR
)/crypto
/md4.
$(LINUX_KMOD_SUFFIX
) \
263 $(LINUX_DIR
)/crypto
/serpent.
$(LINUX_KMOD_SUFFIX
) \
264 $(LINUX_DIR
)/crypto
/sha256
$(SHA256_SUFFIX
).
$(LINUX_KMOD_SUFFIX
) \
265 $(LINUX_DIR
)/crypto
/sha512
$(SHA512_SUFFIX
).
$(LINUX_KMOD_SUFFIX
) \
266 $(LINUX_DIR
)/crypto
/tea.
$(LINUX_KMOD_SUFFIX
) \
267 $(LINUX_DIR
)/crypto
/twofish.
$(LINUX_KMOD_SUFFIX
) \
268 $(LINUX_DIR
)/crypto
/wp512.
$(LINUX_KMOD_SUFFIX
)
271 define KernelPackage
/crypto-misc
/2.6
273 $(LINUX_DIR
)/crypto
/camellia.
$(LINUX_KMOD_SUFFIX
) \
274 $(LINUX_DIR
)/crypto
/crc32c.
$(LINUX_KMOD_SUFFIX
) \
275 $(LINUX_DIR
)/crypto
/fcrypt.
$(LINUX_KMOD_SUFFIX
) \
276 $(LINUX_DIR
)/crypto
/tgr192.
$(LINUX_KMOD_SUFFIX
)
279 $(eval
$(call KernelPackage
,crypto-misc
))
281 define KernelPackage
/crypto-ocf
282 SUBMENU
:=$(CRYPTO_MENU
)
284 DEPENDS
:=+kmod-crypto-core @
!TARGET_uml
287 CONFIG_OCF_CRYPTODEV \
288 CONFIG_OCF_CRYPTOSOFT \
290 CONFIG_OCF_RANDOMHARVEST
=y
292 $(LINUX_DIR
)/crypto
/ocf
/ocf.
$(LINUX_KMOD_SUFFIX
) \
293 $(LINUX_DIR
)/crypto
/ocf
/cryptodev.
$(LINUX_KMOD_SUFFIX
) \
294 $(LINUX_DIR
)/crypto
/ocf
/cryptosoft.
$(LINUX_KMOD_SUFFIX
)
295 AUTOLOAD
:=$(call AutoLoad
,09, \
302 $(eval
$(call KernelPackage
,crypto-ocf
))
305 define KernelPackage
/crypto-null
306 SUBMENU
:=$(CRYPTO_MENU
)
307 TITLE
:=Null CryptoAPI module
308 DEPENDS
:=+kmod-crypto-core
309 KCONFIG
:=CONFIG_CRYPTO_NULL
310 FILES
:=$(LINUX_DIR
)/crypto
/crypto_null.
$(LINUX_KMOD_SUFFIX
)
311 AUTOLOAD
:=$(call AutoLoad
,09,crypto_null
)
314 $(eval
$(call KernelPackage
,crypto-null
))
317 define KernelPackage
/crypto-test
318 SUBMENU
:=$(CRYPTO_MENU
)
319 TITLE
:=Test CryptoAPI module
320 DEPENDS
:=+kmod-crypto-core
321 KCONFIG
:=CONFIG_CRYPTO_TEST
322 FILES
:=$(LINUX_DIR
)/crypto
/tcrypt.
$(LINUX_KMOD_SUFFIX
)
325 $(eval
$(call KernelPackage
,crypto-test
))