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 ALGAPI
=crypto_algapi \
35 BLKCIPHER
=$(BLKCIPHER_PREFIX
)blkcipher \
42 crypto_confvar
=CONFIG_CRYPTO_
$(word 1,$(subst =,$(space
),$(1)))
43 crypto_file
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(LINUX_DIR
)/crypto
/$(word 2,$(subst =,$(space
),$(1))).
$(LINUX_KMOD_SUFFIX
))
44 crypto_name
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(word 2,$(subst =,$(space
),$(1))))
46 # XXX: added CONFIG_CRYPTO_HMAC to KCONFIG so that CONFIG_CRYPTO_HASH is
47 # always set, even if no hash modules are selected
48 define KernelPackage
/crypto-core
49 SUBMENU
:=$(CRYPTO_MENU
)
50 TITLE
:=Core CryptoAPI modules
51 KCONFIG
:=CONFIG_CRYPTO
=y CONFIG_CRYPTO_HMAC
$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_confvar
,$(mod
)))
52 FILES
:=$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_file
,$(mod
)))
53 AUTOLOAD
:=$(call AutoLoad
,01,$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_name
,$(mod
))))
56 define KernelPackage
/crypto-core
/2.4
57 FILES
:=$(LINUX_DIR
)/crypto
/deflate.
$(LINUX_KMOD_SUFFIX
)
58 AUTOLOAD
:=$(call AutoLoad
,01, deflate
)
61 $(eval
$(call KernelPackage
,crypto-core
))
64 define KernelPackage
/crypto-hw-padlock
65 SUBMENU
:=$(CRYPTO_MENU
)
66 TITLE
:=VIA PadLock ACE with AES
/SHA hw crypto module
67 DEPENDS
:=+kmod-crypto-core
70 CONFIG_CRYPTO_DEV_PADLOCK \
71 CONFIG_CRYPTO_DEV_PADLOCK_AES \
72 CONFIG_CRYPTO_DEV_PADLOCK_SHA
74 $(LINUX_DIR
)/drivers
/crypto
/padlock-aes.
$(LINUX_KMOD_SUFFIX
) \
75 $(LINUX_DIR
)/drivers
/crypto
/padlock-sha.
$(LINUX_KMOD_SUFFIX
)
76 AUTOLOAD
:=$(call AutoLoad
,09,padlock-aes padlock-sha
)
79 $(eval
$(call KernelPackage
,crypto-hw-padlock
))
82 define KernelPackage
/crypto-hw-geode
83 SUBMENU
:=$(CRYPTO_MENU
)
84 TITLE
:=AMD Geode hardware crypto module
85 DEPENDS
:=+kmod-crypto-core
88 CONFIG_CRYPTO_DEV_GEODE
89 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/geode-aes.
$(LINUX_KMOD_SUFFIX
)
90 AUTOLOAD
:=$(call AutoLoad
,09,geode-aes
)
93 $(eval
$(call KernelPackage
,crypto-hw-geode
))
96 define KernelPackage
/crypto-hw-hifn-795x
97 SUBMENU
:=$(CRYPTO_MENU
)
98 TITLE
:=HIFN
795x crypto accelerator
99 DEPENDS
:=+kmod-crypto-core
+kmod-crypto-des
102 CONFIG_CRYPTO_DEV_HIFN_795X \
103 CONFIG_CRYPTO_DEV_HIFN_795X_RNG
=y
104 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/hifn_795x.
$(LINUX_KMOD_SUFFIX
)
105 AUTOLOAD
:=$(call AutoLoad
,09,hifn_795x
)
108 $(eval
$(call KernelPackage
,crypto-hw-hifn-795x
))
111 define KernelPackage
/crypto-hw-ixp4xx
112 SUBMENU
:=$(CRYPTO_MENU
)
113 TITLE
:=Intel IXP4xx hardware crypto module
115 @TARGET_ixp4xx
+kmod-crypto-core
+kmod-crypto-des
+kmod-crypto-authenc
116 KCONFIG
:= CONFIG_CRYPTO_DEV_IXP4XX
117 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/ixp4xx_crypto.
$(LINUX_KMOD_SUFFIX
)
118 AUTOLOAD
:=$(call AutoLoad
,90,ixp4xx_crypto
)
121 define KernelPackage
/crypto-hw-ixp4xx
/description
122 Kernel support for the Intel IXP4xx HW crypto engine.
125 $(eval
$(call KernelPackage
,crypto-hw-ixp4xx
))
128 define KernelPackage
/crypto-aes
129 SUBMENU
:=$(CRYPTO_MENU
)
130 TITLE
:=AES cipher CryptoAPI module
131 DEPENDS
:=+kmod-crypto-core
132 KCONFIG
:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
133 FILES
:=$(LINUX_DIR
)/crypto
/aes
$(AES_SUFFIX
).
$(LINUX_KMOD_SUFFIX
)
134 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
))
137 define KernelPackage
/crypto-aes
/x86-2.6
138 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/aes-i586.
$(LINUX_KMOD_SUFFIX
)
139 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
) aes-i586
)
142 $(eval
$(call KernelPackage
,crypto-aes
))
145 define KernelPackage
/crypto-arc4
146 SUBMENU
:=$(CRYPTO_MENU
)
147 TITLE
:=ARC4
(RC4
) cipher CryptoAPI module
148 DEPENDS
:=+kmod-crypto-core
149 KCONFIG
:=CONFIG_CRYPTO_ARC4
150 FILES
:=$(LINUX_DIR
)/crypto
/arc4.
$(LINUX_KMOD_SUFFIX
)
151 AUTOLOAD
:=$(call AutoLoad
,09,arc4
)
154 $(eval
$(call KernelPackage
,crypto-arc4
))
157 define KernelPackage
/crypto-authenc
158 SUBMENU
:=$(CRYPTO_MENU
)
159 TITLE
:=Combined mode wrapper for IPsec
160 DEPENDS
:=+kmod-crypto-core
161 KCONFIG
:=CONFIG_CRYPTO_AUTHENC
162 FILES
:=$(LINUX_DIR
)/crypto
/authenc.
$(LINUX_KMOD_SUFFIX
)
163 AUTOLOAD
:=$(call AutoLoad
,09,authenc
)
166 $(eval
$(call KernelPackage
,crypto-authenc
))
168 define KernelPackage
/crypto-des
169 SUBMENU
:=$(CRYPTO_MENU
)
170 TITLE
:=DES
/3DES cipher CryptoAPI module
171 DEPENDS
:=+kmod-crypto-core
172 KCONFIG
:=CONFIG_CRYPTO_DES
173 FILES
:=$(LINUX_DIR
)/crypto
/des
$(DES_SUFFIX
).
$(LINUX_KMOD_SUFFIX
)
174 AUTOLOAD
:=$(call AutoLoad
,09,des
$(DES_SUFFIX
))
177 $(eval
$(call KernelPackage
,crypto-des
))
180 define KernelPackage
/crypto-hmac
181 SUBMENU
:=$(CRYPTO_MENU
)
182 TITLE
:=HMAC digest CryptoAPI module
183 DEPENDS
:=+kmod-crypto-core
184 KCONFIG
:=CONFIG_CRYPTO_HMAC
185 FILES
:=$(LINUX_DIR
)/crypto
/hmac.
$(LINUX_KMOD_SUFFIX
)
186 AUTOLOAD
:=$(call AutoLoad
,09,hmac
)
189 $(eval
$(call KernelPackage
,crypto-hmac
))
192 define KernelPackage
/crypto-md5
193 SUBMENU
:=$(CRYPTO_MENU
)
194 TITLE
:=MD5 digest CryptoAPI module
195 DEPENDS
:=+kmod-crypto-core
196 KCONFIG
:=CONFIG_CRYPTO_MD5
197 FILES
:=$(LINUX_DIR
)/crypto
/md5.
$(LINUX_KMOD_SUFFIX
)
198 AUTOLOAD
:=$(call AutoLoad
,09,md5
)
201 $(eval
$(call KernelPackage
,crypto-md5
))
204 define KernelPackage
/crypto-michael-mic
205 SUBMENU
:=$(CRYPTO_MENU
)
206 TITLE
:=Michael MIC keyed digest CryptoAPI module
207 DEPENDS
:=+kmod-crypto-core
208 KCONFIG
:=CONFIG_CRYPTO_MICHAEL_MIC
209 FILES
:=$(LINUX_DIR
)/crypto
/michael_mic.
$(LINUX_KMOD_SUFFIX
)
210 AUTOLOAD
:=$(call AutoLoad
,09,michael_mic
)
213 $(eval
$(call KernelPackage
,crypto-michael-mic
))
216 define KernelPackage
/crypto-sha1
217 SUBMENU
:=$(CRYPTO_MENU
)
218 TITLE
:=SHA1 digest CryptoAPI module
219 DEPENDS
:=+kmod-crypto-core
220 KCONFIG
:=CONFIG_CRYPTO_SHA1
221 FILES
:=$(LINUX_DIR
)/crypto
/sha1
$(SHA1_SUFFIX
).
$(LINUX_KMOD_SUFFIX
)
222 AUTOLOAD
:=$(call AutoLoad
,09,sha1
$(SHA1_SUFFIX
))
225 $(eval
$(call KernelPackage
,crypto-sha1
))
228 define KernelPackage
/crypto-misc
229 SUBMENU
:=$(CRYPTO_MENU
)
230 TITLE
:=Other CryptoAPI modules
231 DEPENDS
:=+kmod-crypto-core
233 CONFIG_CRYPTO_ANUBIS \
234 CONFIG_CRYPTO_BLOWFISH \
235 CONFIG_CRYPTO_CAMELLIA \
236 CONFIG_CRYPTO_CAST5 \
237 CONFIG_CRYPTO_CAST6 \
238 CONFIG_CRYPTO_CRC32C \
239 CONFIG_CRYPTO_FCRYPT \
240 CONFIG_CRYPTO_KHAZAD \
242 CONFIG_CRYPTO_SERPENT \
243 CONFIG_CRYPTO_SHA256 \
244 CONFIG_CRYPTO_SHA512 \
246 CONFIG_CRYPTO_TGR192 \
247 CONFIG_CRYPTO_TWOFISH \
248 CONFIG_CRYPTO_TWOFISH_586 \
251 $(LINUX_DIR
)/crypto
/anubis.
$(LINUX_KMOD_SUFFIX
) \
252 $(LINUX_DIR
)/crypto
/blowfish.
$(LINUX_KMOD_SUFFIX
) \
253 $(LINUX_DIR
)/crypto
/cast5.
$(LINUX_KMOD_SUFFIX
) \
254 $(LINUX_DIR
)/crypto
/cast6.
$(LINUX_KMOD_SUFFIX
) \
255 $(LINUX_DIR
)/crypto
/khazad.
$(LINUX_KMOD_SUFFIX
) \
256 $(LINUX_DIR
)/crypto
/md4.
$(LINUX_KMOD_SUFFIX
) \
257 $(LINUX_DIR
)/crypto
/serpent.
$(LINUX_KMOD_SUFFIX
) \
258 $(LINUX_DIR
)/crypto
/sha256
$(SHA256_SUFFIX
).
$(LINUX_KMOD_SUFFIX
) \
259 $(LINUX_DIR
)/crypto
/sha512
$(SHA512_SUFFIX
).
$(LINUX_KMOD_SUFFIX
) \
260 $(LINUX_DIR
)/crypto
/tea.
$(LINUX_KMOD_SUFFIX
) \
261 $(LINUX_DIR
)/crypto
/twofish.
$(LINUX_KMOD_SUFFIX
) \
262 $(LINUX_DIR
)/crypto
/wp512.
$(LINUX_KMOD_SUFFIX
)
265 define KernelPackage
/crypto-misc
/2.6
267 $(LINUX_DIR
)/crypto
/camellia.
$(LINUX_KMOD_SUFFIX
) \
268 $(LINUX_DIR
)/crypto
/crc32c.
$(LINUX_KMOD_SUFFIX
) \
269 $(LINUX_DIR
)/crypto
/fcrypt.
$(LINUX_KMOD_SUFFIX
) \
270 $(LINUX_DIR
)/crypto
/tgr192.
$(LINUX_KMOD_SUFFIX
)
273 $(eval
$(call KernelPackage
,crypto-misc
))
275 define KernelPackage
/crypto-ocf
276 SUBMENU
:=$(CRYPTO_MENU
)
278 DEPENDS
:=+kmod-crypto-core @
!TARGET_uml
281 CONFIG_OCF_CRYPTODEV \
282 CONFIG_OCF_CRYPTOSOFT \
284 CONFIG_OCF_RANDOMHARVEST
=y
286 $(LINUX_DIR
)/crypto
/ocf
/ocf.
$(LINUX_KMOD_SUFFIX
) \
287 $(LINUX_DIR
)/crypto
/ocf
/cryptodev.
$(LINUX_KMOD_SUFFIX
) \
288 $(LINUX_DIR
)/crypto
/ocf
/cryptosoft.
$(LINUX_KMOD_SUFFIX
)
289 AUTOLOAD
:=$(call AutoLoad
,09, \
296 $(eval
$(call KernelPackage
,crypto-ocf
))
299 define KernelPackage
/crypto-null
300 SUBMENU
:=$(CRYPTO_MENU
)
301 TITLE
:=Null CryptoAPI module
302 DEPENDS
:=+kmod-crypto-core
303 KCONFIG
:=CONFIG_CRYPTO_NULL
304 FILES
:=$(LINUX_DIR
)/crypto
/crypto_null.
$(LINUX_KMOD_SUFFIX
)
305 AUTOLOAD
:=$(call AutoLoad
,09,crypto_null
)
308 $(eval
$(call KernelPackage
,crypto-null
))
311 define KernelPackage
/crypto-test
312 SUBMENU
:=$(CRYPTO_MENU
)
313 TITLE
:=Test CryptoAPI module
314 DEPENDS
:=+kmod-crypto-core
315 KCONFIG
:=CONFIG_CRYPTO_TEST
316 FILES
:=$(LINUX_DIR
)/crypto
/tcrypt.
$(LINUX_KMOD_SUFFIX
)
319 $(eval
$(call KernelPackage
,crypto-test
))