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-aes
143 SUBMENU
:=$(CRYPTO_MENU
)
144 TITLE
:=AES cipher CryptoAPI module
145 DEPENDS
:=+kmod-crypto-core
146 KCONFIG
:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
147 FILES
:=$(LINUX_DIR
)/crypto
/aes
$(AES_SUFFIX
).
$(LINUX_KMOD_SUFFIX
)
148 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
))
151 define KernelPackage
/crypto-aes
/x86-2.6
152 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/aes-i586.
$(LINUX_KMOD_SUFFIX
)
153 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
) aes-i586
)
156 $(eval
$(call KernelPackage
,crypto-aes
))
159 define KernelPackage
/crypto-arc4
160 SUBMENU
:=$(CRYPTO_MENU
)
161 TITLE
:=ARC4
(RC4
) cipher CryptoAPI module
162 DEPENDS
:=+kmod-crypto-core
163 KCONFIG
:=CONFIG_CRYPTO_ARC4
164 FILES
:=$(LINUX_DIR
)/crypto
/arc4.
$(LINUX_KMOD_SUFFIX
)
165 AUTOLOAD
:=$(call AutoLoad
,09,arc4
)
168 $(eval
$(call KernelPackage
,crypto-arc4
))
171 define KernelPackage
/crypto-authenc
172 SUBMENU
:=$(CRYPTO_MENU
)
173 TITLE
:=Combined mode wrapper for IPsec
174 DEPENDS
:=+kmod-crypto-core
175 KCONFIG
:=CONFIG_CRYPTO_AUTHENC
176 FILES
:=$(LINUX_DIR
)/crypto
/authenc.
$(LINUX_KMOD_SUFFIX
)
177 AUTOLOAD
:=$(call AutoLoad
,09,authenc
)
180 $(eval
$(call KernelPackage
,crypto-authenc
))
182 define KernelPackage
/crypto-des
183 SUBMENU
:=$(CRYPTO_MENU
)
184 TITLE
:=DES
/3DES cipher CryptoAPI module
185 DEPENDS
:=+kmod-crypto-core
186 KCONFIG
:=CONFIG_CRYPTO_DES
187 FILES
:=$(LINUX_DIR
)/crypto
/des
$(DES_SUFFIX
).
$(LINUX_KMOD_SUFFIX
)
188 AUTOLOAD
:=$(call AutoLoad
,09,des
$(DES_SUFFIX
))
191 $(eval
$(call KernelPackage
,crypto-des
))
194 define KernelPackage
/crypto-hmac
195 SUBMENU
:=$(CRYPTO_MENU
)
196 TITLE
:=HMAC digest CryptoAPI module
197 DEPENDS
:=+kmod-crypto-core
198 KCONFIG
:=CONFIG_CRYPTO_HMAC
199 FILES
:=$(LINUX_DIR
)/crypto
/hmac.
$(LINUX_KMOD_SUFFIX
)
200 AUTOLOAD
:=$(call AutoLoad
,09,hmac
)
203 $(eval
$(call KernelPackage
,crypto-hmac
))
206 define KernelPackage
/crypto-md5
207 SUBMENU
:=$(CRYPTO_MENU
)
208 TITLE
:=MD5 digest CryptoAPI module
209 DEPENDS
:=+kmod-crypto-core
210 KCONFIG
:=CONFIG_CRYPTO_MD5
211 FILES
:=$(LINUX_DIR
)/crypto
/md5.
$(LINUX_KMOD_SUFFIX
)
212 AUTOLOAD
:=$(call AutoLoad
,09,md5
)
215 $(eval
$(call KernelPackage
,crypto-md5
))
218 define KernelPackage
/crypto-michael-mic
219 SUBMENU
:=$(CRYPTO_MENU
)
220 TITLE
:=Michael MIC keyed digest CryptoAPI module
221 DEPENDS
:=+kmod-crypto-core
222 KCONFIG
:=CONFIG_CRYPTO_MICHAEL_MIC
223 FILES
:=$(LINUX_DIR
)/crypto
/michael_mic.
$(LINUX_KMOD_SUFFIX
)
224 AUTOLOAD
:=$(call AutoLoad
,09,michael_mic
)
227 $(eval
$(call KernelPackage
,crypto-michael-mic
))
230 define KernelPackage
/crypto-sha1
231 SUBMENU
:=$(CRYPTO_MENU
)
232 TITLE
:=SHA1 digest CryptoAPI module
233 DEPENDS
:=+kmod-crypto-core
234 KCONFIG
:=CONFIG_CRYPTO_SHA1
235 FILES
:=$(LINUX_DIR
)/crypto
/sha1
$(SHA1_SUFFIX
).
$(LINUX_KMOD_SUFFIX
)
236 AUTOLOAD
:=$(call AutoLoad
,09,sha1
$(SHA1_SUFFIX
))
239 $(eval
$(call KernelPackage
,crypto-sha1
))
242 define KernelPackage
/crypto-misc
243 SUBMENU
:=$(CRYPTO_MENU
)
244 TITLE
:=Other CryptoAPI modules
245 DEPENDS
:=+kmod-crypto-core
247 CONFIG_CRYPTO_ANUBIS \
248 CONFIG_CRYPTO_BLOWFISH \
249 CONFIG_CRYPTO_CAMELLIA \
250 CONFIG_CRYPTO_CAST5 \
251 CONFIG_CRYPTO_CAST6 \
252 CONFIG_CRYPTO_CRC32C \
253 CONFIG_CRYPTO_FCRYPT \
254 CONFIG_CRYPTO_KHAZAD \
256 CONFIG_CRYPTO_SERPENT \
257 CONFIG_CRYPTO_SHA256 \
258 CONFIG_CRYPTO_SHA512 \
260 CONFIG_CRYPTO_TGR192 \
261 CONFIG_CRYPTO_TWOFISH \
262 CONFIG_CRYPTO_TWOFISH_586 \
265 $(LINUX_DIR
)/crypto
/anubis.
$(LINUX_KMOD_SUFFIX
) \
266 $(LINUX_DIR
)/crypto
/blowfish.
$(LINUX_KMOD_SUFFIX
) \
267 $(LINUX_DIR
)/crypto
/cast5.
$(LINUX_KMOD_SUFFIX
) \
268 $(LINUX_DIR
)/crypto
/cast6.
$(LINUX_KMOD_SUFFIX
) \
269 $(LINUX_DIR
)/crypto
/khazad.
$(LINUX_KMOD_SUFFIX
) \
270 $(LINUX_DIR
)/crypto
/md4.
$(LINUX_KMOD_SUFFIX
) \
271 $(LINUX_DIR
)/crypto
/serpent.
$(LINUX_KMOD_SUFFIX
) \
272 $(LINUX_DIR
)/crypto
/sha256
$(SHA256_SUFFIX
).
$(LINUX_KMOD_SUFFIX
) \
273 $(LINUX_DIR
)/crypto
/sha512
$(SHA512_SUFFIX
).
$(LINUX_KMOD_SUFFIX
) \
274 $(LINUX_DIR
)/crypto
/tea.
$(LINUX_KMOD_SUFFIX
) \
275 $(LINUX_DIR
)/crypto
/twofish.
$(LINUX_KMOD_SUFFIX
) \
276 $(LINUX_DIR
)/crypto
/wp512.
$(LINUX_KMOD_SUFFIX
)
279 define KernelPackage
/crypto-misc
/2.6
281 $(LINUX_DIR
)/crypto
/camellia.
$(LINUX_KMOD_SUFFIX
) \
282 $(LINUX_DIR
)/crypto
/crc32c.
$(LINUX_KMOD_SUFFIX
) \
283 $(LINUX_DIR
)/crypto
/fcrypt.
$(LINUX_KMOD_SUFFIX
) \
284 $(LINUX_DIR
)/crypto
/tgr192.
$(LINUX_KMOD_SUFFIX
)
287 $(eval
$(call KernelPackage
,crypto-misc
))
289 define KernelPackage
/crypto-ocf
290 SUBMENU
:=$(CRYPTO_MENU
)
292 DEPENDS
:=+kmod-crypto-core @
!TARGET_uml
295 CONFIG_OCF_CRYPTODEV \
296 CONFIG_OCF_CRYPTOSOFT \
298 CONFIG_OCF_RANDOMHARVEST
=y
300 $(LINUX_DIR
)/crypto
/ocf
/ocf.
$(LINUX_KMOD_SUFFIX
) \
301 $(LINUX_DIR
)/crypto
/ocf
/cryptodev.
$(LINUX_KMOD_SUFFIX
) \
302 $(LINUX_DIR
)/crypto
/ocf
/cryptosoft.
$(LINUX_KMOD_SUFFIX
)
303 AUTOLOAD
:=$(call AutoLoad
,09, \
310 $(eval
$(call KernelPackage
,crypto-ocf
))
313 define KernelPackage
/crypto-null
314 SUBMENU
:=$(CRYPTO_MENU
)
315 TITLE
:=Null CryptoAPI module
316 DEPENDS
:=+kmod-crypto-core
317 KCONFIG
:=CONFIG_CRYPTO_NULL
318 FILES
:=$(LINUX_DIR
)/crypto
/crypto_null.
$(LINUX_KMOD_SUFFIX
)
319 AUTOLOAD
:=$(call AutoLoad
,09,crypto_null
)
322 $(eval
$(call KernelPackage
,crypto-null
))
325 define KernelPackage
/crypto-test
326 SUBMENU
:=$(CRYPTO_MENU
)
327 TITLE
:=Test CryptoAPI module
328 DEPENDS
:=+kmod-crypto-core
329 KCONFIG
:=CONFIG_CRYPTO_TEST
330 FILES
:=$(LINUX_DIR
)/crypto
/tcrypt.
$(LINUX_KMOD_SUFFIX
)
333 $(eval
$(call KernelPackage
,crypto-test
))