source: trunk/package/kernel/modules/crypto.mk @ 25491

Last change on this file since 25491 was 25491, checked in by nbd, 5 years ago

move the deflate crypto module out of the crypto core and into a separate package - it is only used for ipsec

  • Property svn:copyright set to Copyright (C) 2007 OpenWrt.org
File size: 10.5 KB
Line 
1#
2# Copyright (C) 2006-2010 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8CRYPTO_MENU:=Cryptographic API modules
9
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)
17CRYPTO_GENERIC:=_generic
18AES_SUFFIX:=$(CRYPTO_GENERIC)
19DES_SUFFIX:=$(CRYPTO_GENERIC)
20SHA1_SUFFIX:=$(CRYPTO_GENERIC)
21SHA256_SUFFIX:=$(CRYPTO_GENERIC)
22SHA512_SUFFIX:=$(CRYPTO_GENERIC)
23
24CRYPTO_MODULES = \
25        $(if $(filter 1,$(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.28)),ALGAPI2,ALGAPI)=crypto_algapi \
26        AEAD2=aead \
27        $(if $(filter 1,$(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.36)),PCOMP2,PCOMP)=pcompress \
28        BLKCIPHER2=crypto_blkcipher \
29        HASH2=crypto_hash \
30        MANAGER2=cryptomgr \
31        CBC=cbc \
32        ECB=ecb
33
34crypto_confvar=CONFIG_CRYPTO_$(word 1,$(subst =,$(space),$(1)))
35crypto_file=$(if $(findstring y,$($(call crypto_confvar,$(1)))),,$(LINUX_DIR)/crypto/$(word 2,$(subst =,$(space),$(1))).ko)
36crypto_name=$(if $(findstring y,$($(call crypto_confvar,$(1)))),,$(word 2,$(subst =,$(space),$(1))))
37
38# XXX: added CONFIG_CRYPTO_HMAC to KCONFIG so that CONFIG_CRYPTO_HASH is
39# always set, even if no hash modules are selected
40define KernelPackage/crypto-core
41  SUBMENU:=$(CRYPTO_MENU)
42  TITLE:=Core CryptoAPI modules
43  KCONFIG:= \
44        CONFIG_CRYPTO=y \
45        CONFIG_CRYPTO_HW=y \
46        CONFIG_CRYPTO_HMAC \
47        $(foreach mod,$(CRYPTO_MODULES),$(call crypto_confvar,$(mod)))
48  FILES:=$(foreach mod,$(CRYPTO_MODULES),$(call crypto_file,$(mod)))
49  AUTOLOAD:=$(call AutoLoad,01,$(foreach mod,$(CRYPTO_MODULES),$(call crypto_name,$(mod))))
50endef
51$(eval $(call KernelPackage,crypto-core))
52
53
54define AddDepends/crypto
55  SUBMENU:=$(CRYPTO_MENU)
56  DEPENDS+=kmod-crypto-core $(1)
57endef
58
59
60define KernelPackage/crypto-hw-padlock
61  TITLE:=VIA PadLock ACE with AES/SHA hw crypto module
62  DEPENDS:=+kmod-crypto-aes
63  KCONFIG:= \
64        CONFIG_CRYPTO_DEV_PADLOCK \
65        CONFIG_CRYPTO_DEV_PADLOCK_AES \
66        CONFIG_CRYPTO_DEV_PADLOCK_SHA
67  FILES:= \
68        $(LINUX_DIR)/drivers/crypto/padlock-aes.ko \
69        $(LINUX_DIR)/drivers/crypto/padlock-sha.ko
70  AUTOLOAD:=$(call AutoLoad,09,padlock-aes padlock-sha)
71  $(call AddDepends/crypto)
72endef
73
74$(eval $(call KernelPackage,crypto-hw-padlock))
75
76
77define KernelPackage/crypto-hw-geode
78  TITLE:=AMD Geode hardware crypto module
79  KCONFIG:= \
80        CONFIG_CRYPTO_DEV_GEODE
81  FILES:=$(LINUX_DIR)/drivers/crypto/geode-aes.ko
82  AUTOLOAD:=$(call AutoLoad,09,geode-aes)
83  $(call AddDepends/crypto)
84endef
85
86$(eval $(call KernelPackage,crypto-hw-geode))
87
88
89define KernelPackage/crypto-hw-hifn-795x
90  TITLE:=HIFN 795x crypto accelerator
91  DEPENDS:=@!TARGET_ubicom32
92  KCONFIG:= \
93        CONFIG_HW_RANDOM=y \
94        CONFIG_CRYPTO_DEV_HIFN_795X \
95        CONFIG_CRYPTO_DEV_HIFN_795X_RNG=y
96  FILES:=$(LINUX_DIR)/drivers/crypto/hifn_795x.ko
97  AUTOLOAD:=$(call AutoLoad,09,hifn_795x)
98  $(call AddDepends/crypto,+kmod-crypto-des)
99endef
100
101$(eval $(call KernelPackage,crypto-hw-hifn-795x))
102
103
104define KernelPackage/crypto-hw-ixp4xx
105  TITLE:=Intel IXP4xx hardware crypto module
106  DEPENDS:=@TARGET_ixp4xx
107  KCONFIG:= \
108        CONFIG_CRYPTO_DEV_IXP4XX
109  FILES:=$(LINUX_DIR)/drivers/crypto/ixp4xx_crypto.ko
110  AUTOLOAD:=$(call AutoLoad,90,ixp4xx_crypto)
111  $(call AddDepends/crypto,+kmod-crypto-authenc +kmod-crypto-des)
112endef
113
114define KernelPackage/crypto-hw-ixp4xx/description
115  Kernel support for the Intel IXP4xx HW crypto engine.
116endef
117
118$(eval $(call KernelPackage,crypto-hw-ixp4xx))
119
120
121define KernelPackage/crypto-hw-ppc4xx
122  TITLE:=AMCC PPC4xx hardware crypto module
123  DEPENDS:=@TARGET_ppc40x||TARGET_ppc44x
124  KCONFIG:= \
125        CONFIG_CRYPTO_DEV_PPC4XX
126  FILES:=$(LINUX_DIR)/drivers/crypto/amcc/crypto4xx.ko
127  AUTOLOAD:=$(call AutoLoad,90,crypto4xx)
128  $(call AddDepends/crypto)
129endef
130
131define KernelPackage/crypto-hw-ppc4xx/description
132  Kernel support for the AMCC PPC4xx HW crypto engine.
133endef
134
135$(eval $(call KernelPackage,crypto-hw-ppc4xx))
136
137
138define KernelPackage/crypto-aes
139  TITLE:=AES cipher CryptoAPI module
140  KCONFIG:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
141  FILES:=$(LINUX_DIR)/crypto/aes$(AES_SUFFIX).ko
142  AUTOLOAD:=$(call AutoLoad,09,aes$(AES_SUFFIX))
143  $(call AddDepends/crypto)
144endef
145
146define KernelPackage/crypto-aes/x86
147  FILES+=$(LINUX_DIR)/arch/x86/crypto/aes-i586.ko
148  AUTOLOAD:=$(call AutoLoad,09,aes$(AES_SUFFIX) aes-i586)
149endef
150
151$(eval $(call KernelPackage,crypto-aes))
152
153
154define KernelPackage/crypto-arc4
155  TITLE:=ARC4 (RC4) cipher CryptoAPI module
156  KCONFIG:=CONFIG_CRYPTO_ARC4
157  FILES:=$(LINUX_DIR)/crypto/arc4.ko
158  AUTOLOAD:=$(call AutoLoad,09,arc4)
159  $(call AddDepends/crypto)
160endef
161
162$(eval $(call KernelPackage,crypto-arc4))
163
164
165define KernelPackage/crypto-authenc
166  TITLE:=Combined mode wrapper for IPsec
167  KCONFIG:=CONFIG_CRYPTO_AUTHENC
168  FILES:=$(LINUX_DIR)/crypto/authenc.ko
169  AUTOLOAD:=$(call AutoLoad,09,authenc)
170  $(call AddDepends/crypto)
171endef
172
173$(eval $(call KernelPackage,crypto-authenc))
174
175define KernelPackage/crypto-des
176  TITLE:=DES/3DES cipher CryptoAPI module
177  KCONFIG:=CONFIG_CRYPTO_DES
178  FILES:=$(LINUX_DIR)/crypto/des$(DES_SUFFIX).ko
179  AUTOLOAD:=$(call AutoLoad,09,des$(DES_SUFFIX))
180  $(call AddDepends/crypto)
181endef
182
183$(eval $(call KernelPackage,crypto-des))
184
185define KernelPackage/crypto-deflate
186  TITLE:=Deflate compression CryptoAPI module
187  KCONFIG:=CONFIG_CRYPTO_DEFLATE
188  FILES:=$(LINUX_DIR)/crypto/deflate.ko
189  AUTOLOAD:=$(call AutoLoad,09,deflate)
190  $(call AddDepends/crypto)
191endef
192
193$(eval $(call KernelPackage,crypto-deflate))
194
195
196define KernelPackage/crypto-hmac
197  TITLE:=HMAC digest CryptoAPI module
198  KCONFIG:=CONFIG_CRYPTO_HMAC
199  FILES:=$(LINUX_DIR)/crypto/hmac.ko
200  AUTOLOAD:=$(call AutoLoad,09,hmac)
201  $(call AddDepends/crypto)
202endef
203
204$(eval $(call KernelPackage,crypto-hmac))
205
206
207define KernelPackage/crypto-md5
208  TITLE:=MD5 digest CryptoAPI module
209  KCONFIG:=CONFIG_CRYPTO_MD5
210  FILES:=$(LINUX_DIR)/crypto/md5.ko
211  AUTOLOAD:=$(call AutoLoad,09,md5)
212  $(call AddDepends/crypto)
213endef
214
215$(eval $(call KernelPackage,crypto-md5))
216
217
218define KernelPackage/crypto-michael-mic
219  TITLE:=Michael MIC keyed digest CryptoAPI module
220  KCONFIG:=CONFIG_CRYPTO_MICHAEL_MIC
221  FILES:=$(LINUX_DIR)/crypto/michael_mic.ko
222  AUTOLOAD:=$(call AutoLoad,09,michael_mic)
223  $(call AddDepends/crypto)
224endef
225
226$(eval $(call KernelPackage,crypto-michael-mic))
227
228
229define KernelPackage/crypto-sha1
230  TITLE:=SHA1 digest CryptoAPI module
231  KCONFIG:=CONFIG_CRYPTO_SHA1
232  FILES:=$(LINUX_DIR)/crypto/sha1$(SHA1_SUFFIX).ko
233  AUTOLOAD:=$(call AutoLoad,09,sha1$(SHA1_SUFFIX))
234  $(call AddDepends/crypto)
235endef
236
237$(eval $(call KernelPackage,crypto-sha1))
238
239
240define KernelPackage/crypto-misc
241  TITLE:=Other CryptoAPI modules
242  KCONFIG:= \
243        CONFIG_CRYPTO_ANUBIS \
244        CONFIG_CRYPTO_BLOWFISH \
245        CONFIG_CRYPTO_CAMELLIA \
246        CONFIG_CRYPTO_CAST5 \
247        CONFIG_CRYPTO_CAST6 \
248        CONFIG_CRYPTO_CRC32C \
249        CONFIG_CRYPTO_FCRYPT \
250        CONFIG_CRYPTO_KHAZAD \
251        CONFIG_CRYPTO_MD4 \
252        CONFIG_CRYPTO_SERPENT \
253        CONFIG_CRYPTO_SHA256 \
254        CONFIG_CRYPTO_SHA512 \
255        CONFIG_CRYPTO_TEA \
256        CONFIG_CRYPTO_TGR192 \
257        CONFIG_CRYPTO_TWOFISH \
258        CONFIG_CRYPTO_TWOFISH_COMMON \
259        CONFIG_CRYPTO_TWOFISH_586 \
260        CONFIG_CRYPTO_WP512
261  FILES:= \
262        $(LINUX_DIR)/crypto/anubis.ko \
263        $(LINUX_DIR)/crypto/blowfish.ko \
264        $(LINUX_DIR)/crypto/cast5.ko \
265        $(LINUX_DIR)/crypto/cast6.ko \
266        $(LINUX_DIR)/crypto/khazad.ko \
267        $(LINUX_DIR)/crypto/md4.ko \
268        $(LINUX_DIR)/crypto/serpent.ko \
269        $(LINUX_DIR)/crypto/sha256$(SHA256_SUFFIX).ko \
270        $(LINUX_DIR)/crypto/sha512$(SHA512_SUFFIX).ko \
271        $(LINUX_DIR)/crypto/tea.ko \
272        $(if $(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),le,2.6.35)),,$(LINUX_DIR)/crypto/twofish.ko) \
273        $(if $(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.36)),,$(LINUX_DIR)/crypto/twofish_generic.ko) \
274        $(LINUX_DIR)/crypto/wp512.ko
275  $(call AddDepends/crypto)
276endef
277
278define KernelPackage/crypto-misc/2.6
279  FILES+= \
280        $(LINUX_DIR)/crypto/camellia.ko \
281        $(if $(findstring y,$(CONFIG_CRYPTO_CRC32C)),,$(LINUX_DIR)/crypto/crc32c.ko) \
282        $(LINUX_DIR)/crypto/fcrypt.ko \
283        $(LINUX_DIR)/crypto/tgr192.ko \
284        $(LINUX_DIR)/crypto/twofish_common.ko
285endef
286
287define KernelPackage/crypto-misc/x86
288  FILES+=$(LINUX_DIR)/arch/x86/crypto/twofish-i586.ko
289endef
290
291$(eval $(call KernelPackage,crypto-misc))
292
293
294define KernelPackage/crypto-ocf
295  TITLE:=OCF modules
296  DEPENDS:=+@OPENSSL_ENGINE @!TARGET_uml
297  KCONFIG:= \
298        CONFIG_OCF_OCF \
299        CONFIG_OCF_CRYPTODEV \
300        CONFIG_OCF_CRYPTOSOFT \
301        CONFIG_OCF_FIPS=y \
302        CONFIG_OCF_RANDOMHARVEST=y
303  FILES:= \
304        $(LINUX_DIR)/crypto/ocf/ocf.ko \
305        $(LINUX_DIR)/crypto/ocf/cryptodev.ko \
306        $(LINUX_DIR)/crypto/ocf/cryptosoft.ko
307  AUTOLOAD:=$(call AutoLoad,09, \
308        ocf \
309        cryptodev \
310        cryptosoft \
311  )
312  $(call AddDepends/crypto)
313endef
314
315$(eval $(call KernelPackage,crypto-ocf))
316
317
318define KernelPackage/crypto-ocf-hifn7751
319  TITLE:=OCF support for Hifn 6500/7751/7811/795x, Invertex AEON and NetSec 7751 devices
320  DEPENDS:=+@OPENSSL_ENGINE @PCI_SUPPORT @!TARGET_uml kmod-crypto-ocf
321  KCONFIG:=CONFIG_OCF_HIFN
322  FILES:=$(LINUX_DIR)/crypto/ocf/hifn/hifn7751.ko
323  AUTOLOAD:=$(call AutoLoad,10,hifn7751)
324  $(call AddDepends/crypto)
325endef
326
327$(eval $(call KernelPackage,crypto-ocf-hifn7751))
328
329
330define KernelPackage/crypto-ocf-hifnhipp
331  TITLE:=OCF support for Hifn 7855/8155 devices
332  DEPENDS:=+@OPENSSL_ENGINE @PCI_SUPPORT @!TARGET_uml kmod-crypto-ocf
333  KCONFIG:=CONFIG_OCF_HIFNHIPP
334  FILES:=$(LINUX_DIR)/crypto/ocf/hifn/hifnHIPP.ko
335  AUTOLOAD:=$(call AutoLoad,10,hifnhipp)
336  $(call AddDepends/crypto)
337endef
338
339$(eval $(call KernelPackage,crypto-ocf-hifnhipp))
340
341
342define KernelPackage/crypto-null
343  TITLE:=Null CryptoAPI module
344  KCONFIG:=CONFIG_CRYPTO_NULL
345  FILES:=$(LINUX_DIR)/crypto/crypto_null.ko
346  AUTOLOAD:=$(call AutoLoad,09,crypto_null)
347  $(call AddDepends/crypto)
348endef
349
350$(eval $(call KernelPackage,crypto-null))
351
352
353define KernelPackage/crypto-test
354  TITLE:=Test CryptoAPI module
355  KCONFIG:=CONFIG_CRYPTO_TEST
356  FILES:=$(LINUX_DIR)/crypto/tcrypt.ko
357  $(call AddDepends/crypto)
358endef
359
360$(eval $(call KernelPackage,crypto-test))
361
362
363define KernelPackage/crypto-xts
364  TITLE:=XTS cipher CryptoAPI module
365  KCONFIG:= \
366        CONFIG_CRYPTO_GF128MUL \
367        CONFIG_CRYPTO_XTS
368  FILES:= \
369        $(LINUX_DIR)/crypto/xts.ko \
370        $(LINUX_DIR)/crypto/gf128mul.ko
371  AUTOLOAD:=$(call AutoLoad,09, \
372        gf128mul \
373        xts \
374  )
375  $(call AddDepends/crypto)
376endef
377
378$(eval $(call KernelPackage,crypto-xts))
379
380define KernelPackage/crypto-mv-cesa
381   TITLE:=Marvell crypto engine
382   KCONFIG:=CONFIG_CRYPTO_DEV_MV_CESA
383   FILES:=$(LINUX_DIR)/drivers/crypto/mv_cesa.ko
384   AUTOLOAD:=$(call AutoLoad,09,mv_cesa)
385   SUBMENU:=Cryptographic API modules
386   DEPENDS:=kmod-crypto-core @TARGET_kirkwood||TARGET_orion
387endef
388
389$(eval $(call KernelPackage,crypto-mv-cesa))
Note: See TracBrowser for help on using the repository browser.