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 $(if
$(LINUX_2_6_30
),PCOMPRESS
=pcompress
) \
36 BLKCIPHER
=$(BLKCIPHER_PREFIX
)blkcipher \
43 crypto_confvar
=CONFIG_CRYPTO_
$(word 1,$(subst =,$(space
),$(1)))
44 crypto_file
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(LINUX_DIR
)/crypto
/$(word 2,$(subst =,$(space
),$(1))).
$(LINUX_KMOD_SUFFIX
))
45 crypto_name
=$(if
$(findstring y
,$($(call crypto_confvar
,$(1)))),,$(word 2,$(subst =,$(space
),$(1))))
47 # XXX: added CONFIG_CRYPTO_HMAC to KCONFIG so that CONFIG_CRYPTO_HASH is
48 # always set, even if no hash modules are selected
49 define KernelPackage
/crypto-core
50 SUBMENU
:=$(CRYPTO_MENU
)
51 TITLE
:=Core CryptoAPI modules
52 KCONFIG
:=CONFIG_CRYPTO
=y CONFIG_CRYPTO_HMAC
$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_confvar
,$(mod
)))
53 FILES
:=$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_file
,$(mod
)))
54 AUTOLOAD
:=$(call AutoLoad
,01,$(foreach mod
,$(CRYPTO_MODULES
),$(call crypto_name
,$(mod
))))
57 define KernelPackage
/crypto-core
/2.4
58 FILES
:=$(LINUX_DIR
)/crypto
/deflate.
$(LINUX_KMOD_SUFFIX
)
59 AUTOLOAD
:=$(call AutoLoad
,01, deflate
)
62 $(eval
$(call KernelPackage
,crypto-core
))
65 define KernelPackage
/crypto-hw-padlock
66 SUBMENU
:=$(CRYPTO_MENU
)
67 TITLE
:=VIA PadLock ACE with AES
/SHA hw crypto module
68 DEPENDS
:=+kmod-crypto-core
71 CONFIG_CRYPTO_DEV_PADLOCK \
72 CONFIG_CRYPTO_DEV_PADLOCK_AES \
73 CONFIG_CRYPTO_DEV_PADLOCK_SHA
75 $(LINUX_DIR
)/drivers
/crypto
/padlock-aes.
$(LINUX_KMOD_SUFFIX
) \
76 $(LINUX_DIR
)/drivers
/crypto
/padlock-sha.
$(LINUX_KMOD_SUFFIX
)
77 AUTOLOAD
:=$(call AutoLoad
,09,padlock-aes padlock-sha
)
80 $(eval
$(call KernelPackage
,crypto-hw-padlock
))
83 define KernelPackage
/crypto-hw-geode
84 SUBMENU
:=$(CRYPTO_MENU
)
85 TITLE
:=AMD Geode hardware crypto module
86 DEPENDS
:=+kmod-crypto-core
89 CONFIG_CRYPTO_DEV_GEODE
90 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/geode-aes.
$(LINUX_KMOD_SUFFIX
)
91 AUTOLOAD
:=$(call AutoLoad
,09,geode-aes
)
94 $(eval
$(call KernelPackage
,crypto-hw-geode
))
97 define KernelPackage
/crypto-hw-hifn-795x
98 SUBMENU
:=$(CRYPTO_MENU
)
99 TITLE
:=HIFN
795x crypto accelerator
100 DEPENDS
:=+kmod-crypto-core
+kmod-crypto-des
103 CONFIG_CRYPTO_DEV_HIFN_795X \
104 CONFIG_CRYPTO_DEV_HIFN_795X_RNG
=y
105 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/hifn_795x.
$(LINUX_KMOD_SUFFIX
)
106 AUTOLOAD
:=$(call AutoLoad
,09,hifn_795x
)
109 $(eval
$(call KernelPackage
,crypto-hw-hifn-795x
))
112 define KernelPackage
/crypto-hw-ixp4xx
113 SUBMENU
:=$(CRYPTO_MENU
)
114 TITLE
:=Intel IXP4xx hardware crypto module
116 @TARGET_ixp4xx
+kmod-crypto-core
+kmod-crypto-des
+kmod-crypto-authenc
117 KCONFIG
:= CONFIG_CRYPTO_DEV_IXP4XX
118 FILES
:=$(LINUX_DIR
)/drivers
/crypto
/ixp4xx_crypto.
$(LINUX_KMOD_SUFFIX
)
119 AUTOLOAD
:=$(call AutoLoad
,90,ixp4xx_crypto
)
122 define KernelPackage
/crypto-hw-ixp4xx
/description
123 Kernel support for the Intel IXP4xx HW crypto engine.
126 $(eval
$(call KernelPackage
,crypto-hw-ixp4xx
))
129 define KernelPackage
/crypto-aes
130 SUBMENU
:=$(CRYPTO_MENU
)
131 TITLE
:=AES cipher CryptoAPI module
132 DEPENDS
:=+kmod-crypto-core
133 KCONFIG
:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
134 FILES
:=$(LINUX_DIR
)/crypto
/aes
$(AES_SUFFIX
).
$(LINUX_KMOD_SUFFIX
)
135 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
))
138 define KernelPackage
/crypto-aes
/x86-2.6
139 FILES
+=$(LINUX_DIR
)/arch
/x86
/crypto
/aes-i586.
$(LINUX_KMOD_SUFFIX
)
140 AUTOLOAD
:=$(call AutoLoad
,09,aes
$(AES_SUFFIX
) aes-i586
)
143 $(eval
$(call KernelPackage
,crypto-aes
))
146 define KernelPackage
/crypto-arc4
147 SUBMENU
:=$(CRYPTO_MENU
)
148 TITLE
:=ARC4
(RC4
) cipher CryptoAPI module
149 DEPENDS
:=+kmod-crypto-core
150 KCONFIG
:=CONFIG_CRYPTO_ARC4
151 FILES
:=$(LINUX_DIR
)/crypto
/arc4.
$(LINUX_KMOD_SUFFIX
)
152 AUTOLOAD
:=$(call AutoLoad
,09,arc4
)
155 $(eval
$(call KernelPackage
,crypto-arc4
))
158 define KernelPackage
/crypto-authenc
159 SUBMENU
:=$(CRYPTO_MENU
)
160 TITLE
:=Combined mode wrapper for IPsec
161 DEPENDS
:=+kmod-crypto-core
162 KCONFIG
:=CONFIG_CRYPTO_AUTHENC
163 FILES
:=$(LINUX_DIR
)/crypto
/authenc.
$(LINUX_KMOD_SUFFIX
)
164 AUTOLOAD
:=$(call AutoLoad
,09,authenc
)
167 $(eval
$(call KernelPackage
,crypto-authenc
))
169 define KernelPackage
/crypto-des
170 SUBMENU
:=$(CRYPTO_MENU
)
171 TITLE
:=DES
/3DES cipher CryptoAPI module
172 DEPENDS
:=+kmod-crypto-core
173 KCONFIG
:=CONFIG_CRYPTO_DES
174 FILES
:=$(LINUX_DIR
)/crypto
/des
$(DES_SUFFIX
).
$(LINUX_KMOD_SUFFIX
)
175 AUTOLOAD
:=$(call AutoLoad
,09,des
$(DES_SUFFIX
))
178 $(eval
$(call KernelPackage
,crypto-des
))
181 define KernelPackage
/crypto-hmac
182 SUBMENU
:=$(CRYPTO_MENU
)
183 TITLE
:=HMAC digest CryptoAPI module
184 DEPENDS
:=+kmod-crypto-core
185 KCONFIG
:=CONFIG_CRYPTO_HMAC
186 FILES
:=$(LINUX_DIR
)/crypto
/hmac.
$(LINUX_KMOD_SUFFIX
)
187 AUTOLOAD
:=$(call AutoLoad
,09,hmac
)
190 $(eval
$(call KernelPackage
,crypto-hmac
))
193 define KernelPackage
/crypto-md5
194 SUBMENU
:=$(CRYPTO_MENU
)
195 TITLE
:=MD5 digest CryptoAPI module
196 DEPENDS
:=+kmod-crypto-core
197 KCONFIG
:=CONFIG_CRYPTO_MD5
198 FILES
:=$(LINUX_DIR
)/crypto
/md5.
$(LINUX_KMOD_SUFFIX
)
199 AUTOLOAD
:=$(call AutoLoad
,09,md5
)
202 $(eval
$(call KernelPackage
,crypto-md5
))
205 define KernelPackage
/crypto-michael-mic
206 SUBMENU
:=$(CRYPTO_MENU
)
207 TITLE
:=Michael MIC keyed digest CryptoAPI module
208 DEPENDS
:=+kmod-crypto-core
209 KCONFIG
:=CONFIG_CRYPTO_MICHAEL_MIC
210 FILES
:=$(LINUX_DIR
)/crypto
/michael_mic.
$(LINUX_KMOD_SUFFIX
)
211 AUTOLOAD
:=$(call AutoLoad
,09,michael_mic
)
214 $(eval
$(call KernelPackage
,crypto-michael-mic
))
217 define KernelPackage
/crypto-sha1
218 SUBMENU
:=$(CRYPTO_MENU
)
219 TITLE
:=SHA1 digest CryptoAPI module
220 DEPENDS
:=+kmod-crypto-core
221 KCONFIG
:=CONFIG_CRYPTO_SHA1
222 FILES
:=$(LINUX_DIR
)/crypto
/sha1
$(SHA1_SUFFIX
).
$(LINUX_KMOD_SUFFIX
)
223 AUTOLOAD
:=$(call AutoLoad
,09,sha1
$(SHA1_SUFFIX
))
226 $(eval
$(call KernelPackage
,crypto-sha1
))
229 define KernelPackage
/crypto-misc
230 SUBMENU
:=$(CRYPTO_MENU
)
231 TITLE
:=Other CryptoAPI modules
232 DEPENDS
:=+kmod-crypto-core
234 CONFIG_CRYPTO_ANUBIS \
235 CONFIG_CRYPTO_BLOWFISH \
236 CONFIG_CRYPTO_CAMELLIA \
237 CONFIG_CRYPTO_CAST5 \
238 CONFIG_CRYPTO_CAST6 \
239 CONFIG_CRYPTO_CRC32C \
240 CONFIG_CRYPTO_FCRYPT \
241 CONFIG_CRYPTO_KHAZAD \
243 CONFIG_CRYPTO_SERPENT \
244 CONFIG_CRYPTO_SHA256 \
245 CONFIG_CRYPTO_SHA512 \
247 CONFIG_CRYPTO_TGR192 \
248 CONFIG_CRYPTO_TWOFISH \
249 CONFIG_CRYPTO_TWOFISH_586 \
252 $(LINUX_DIR
)/crypto
/anubis.
$(LINUX_KMOD_SUFFIX
) \
253 $(LINUX_DIR
)/crypto
/blowfish.
$(LINUX_KMOD_SUFFIX
) \
254 $(LINUX_DIR
)/crypto
/cast5.
$(LINUX_KMOD_SUFFIX
) \
255 $(LINUX_DIR
)/crypto
/cast6.
$(LINUX_KMOD_SUFFIX
) \
256 $(LINUX_DIR
)/crypto
/khazad.
$(LINUX_KMOD_SUFFIX
) \
257 $(LINUX_DIR
)/crypto
/md4.
$(LINUX_KMOD_SUFFIX
) \
258 $(LINUX_DIR
)/crypto
/serpent.
$(LINUX_KMOD_SUFFIX
) \
259 $(LINUX_DIR
)/crypto
/sha256
$(SHA256_SUFFIX
).
$(LINUX_KMOD_SUFFIX
) \
260 $(LINUX_DIR
)/crypto
/sha512
$(SHA512_SUFFIX
).
$(LINUX_KMOD_SUFFIX
) \
261 $(LINUX_DIR
)/crypto
/tea.
$(LINUX_KMOD_SUFFIX
) \
262 $(LINUX_DIR
)/crypto
/twofish.
$(LINUX_KMOD_SUFFIX
) \
263 $(LINUX_DIR
)/crypto
/wp512.
$(LINUX_KMOD_SUFFIX
)
266 define KernelPackage
/crypto-misc
/2.6
268 $(LINUX_DIR
)/crypto
/camellia.
$(LINUX_KMOD_SUFFIX
) \
269 $(LINUX_DIR
)/crypto
/crc32c.
$(LINUX_KMOD_SUFFIX
) \
270 $(LINUX_DIR
)/crypto
/fcrypt.
$(LINUX_KMOD_SUFFIX
) \
271 $(LINUX_DIR
)/crypto
/tgr192.
$(LINUX_KMOD_SUFFIX
)
274 $(eval
$(call KernelPackage
,crypto-misc
))
276 define KernelPackage
/crypto-ocf
277 SUBMENU
:=$(CRYPTO_MENU
)
279 DEPENDS
:=+kmod-crypto-core @
!TARGET_uml
282 CONFIG_OCF_CRYPTODEV \
283 CONFIG_OCF_CRYPTOSOFT \
285 CONFIG_OCF_RANDOMHARVEST
=y
287 $(LINUX_DIR
)/crypto
/ocf
/ocf.
$(LINUX_KMOD_SUFFIX
) \
288 $(LINUX_DIR
)/crypto
/ocf
/cryptodev.
$(LINUX_KMOD_SUFFIX
) \
289 $(LINUX_DIR
)/crypto
/ocf
/cryptosoft.
$(LINUX_KMOD_SUFFIX
)
290 AUTOLOAD
:=$(call AutoLoad
,09, \
297 $(eval
$(call KernelPackage
,crypto-ocf
))
300 define KernelPackage
/crypto-null
301 SUBMENU
:=$(CRYPTO_MENU
)
302 TITLE
:=Null CryptoAPI module
303 DEPENDS
:=+kmod-crypto-core
304 KCONFIG
:=CONFIG_CRYPTO_NULL
305 FILES
:=$(LINUX_DIR
)/crypto
/crypto_null.
$(LINUX_KMOD_SUFFIX
)
306 AUTOLOAD
:=$(call AutoLoad
,09,crypto_null
)
309 $(eval
$(call KernelPackage
,crypto-null
))
312 define KernelPackage
/crypto-test
313 SUBMENU
:=$(CRYPTO_MENU
)
314 TITLE
:=Test CryptoAPI module
315 DEPENDS
:=+kmod-crypto-core
316 KCONFIG
:=CONFIG_CRYPTO_TEST
317 FILES
:=$(LINUX_DIR
)/crypto
/tcrypt.
$(LINUX_KMOD_SUFFIX
)
320 $(eval
$(call KernelPackage
,crypto-test
))