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

Last change on this file since 26815 was 26815, checked in by jow, 6 years ago

[package] kernel: revert r26814

  • Property svn:copyright set to Copyright (C) 2007 OpenWrt.org
File size: 12.7 KB
Line 
1#
2# Copyright (C) 2006-2011 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 = ALGAPI2=crypto_algapi
25
26CRYPTOMGR_MODULES = \
27        AEAD2=aead \
28        MANAGER2=cryptomgr \
29        BLKCIPHER2=crypto_blkcipher
30
31crypto_confvar=CONFIG_CRYPTO_$(word 1,$(subst =,$(space),$(1)))
32crypto_file=$(if $(findstring y,$($(call crypto_confvar,$(1)))),,$(LINUX_DIR)/crypto/$(word 2,$(subst =,$(space),$(1))).ko)
33crypto_name=$(if $(findstring y,$($(call crypto_confvar,$(1)))),,$(word 2,$(subst =,$(space),$(1))))
34
35# XXX: added CONFIG_CRYPTO_HMAC to KCONFIG so that CONFIG_CRYPTO_HASH is
36# always set, even if no hash modules are selected
37define KernelPackage/crypto-core
38  SUBMENU:=$(CRYPTO_MENU)
39  TITLE:=Core CryptoAPI modules
40  KCONFIG:= \
41        CONFIG_CRYPTO=y \
42        CONFIG_CRYPTO_HW=y \
43        CONFIG_CRYPTO_ALGAPI \
44        $(foreach mod,$(CRYPTO_MODULES),$(call crypto_confvar,$(mod)))
45  FILES:=$(foreach mod,$(CRYPTO_MODULES),$(call crypto_file,$(mod)))
46  AUTOLOAD:=$(call AutoLoad,01,$(foreach mod,$(CRYPTO_MODULES),$(call crypto_name,$(mod))))
47endef
48$(eval $(call KernelPackage,crypto-core))
49
50
51define AddDepends/crypto
52  SUBMENU:=$(CRYPTO_MENU)
53  DEPENDS+=kmod-crypto-core $(1)
54endef
55
56define KernelPackage/crypto-hash
57  TITLE:=CryptoAPI hash support
58  KCONFIG:=CONFIG_CRYPTO_HASH
59  FILES:=$(LINUX_DIR)/crypto/crypto_hash.ko
60  AUTOLOAD:=$(call AutoLoad,02,crypto_hash)
61  $(call AddDepends/crypto)
62endef
63$(eval $(call KernelPackage,crypto-hash))
64
65define KernelPackage/crypto-manager
66  TITLE:=CryptoAPI algorithm manager
67  DEPENDS:=+kmod-crypto-hash
68  KCONFIG:= \
69        CONFIG_CRYPTO_AEAD \
70        CONFIG_CRYPTO_BLKCIPHER \
71        CONFIG_CRYPTO_MANAGER \
72        $(foreach mod,$(CRYPTOMGR_MODULES),$(call crypto_confvar,$(mod)))
73  FILES:=$(foreach mod,$(CRYPTOMGR_MODULES),$(call crypto_file,$(mod)))
74  AUTOLOAD:=$(call AutoLoad,03,$(foreach mod,$(CRYPTOMGR_MODULES),$(call crypto_name,$(mod))))
75  $(call AddDepends/crypto)
76endef
77$(eval $(call KernelPackage,crypto-manager))
78
79define KernelPackage/crypto-wq
80  TITLE:=CryptoAPI work queue handling
81  KCONFIG:=CONFIG_CRYPTO_WORKQUEUE
82  FILES:=$(LINUX_DIR)/crypto/crypto_wq.ko
83  AUTOLOAD:=$(call AutoLoad,09,crypto_wq)
84  $(call AddDepends/crypto)
85endef
86$(eval $(call KernelPackage,crypto-wq))
87
88define KernelPackage/crypto-rng
89  TITLE:=CryptoAPI random number generation
90  KCONFIG:=CONFIG_CRYPTO_RNG2
91  FILES:= \
92        $(LINUX_DIR)/crypto/rng.ko \
93        $(LINUX_DIR)/crypto/krng.ko
94  AUTOLOAD:=$(call AutoLoad,09,rng krng)
95  $(call AddDepends/crypto)
96endef
97$(eval $(call KernelPackage,crypto-rng))
98
99define KernelPackage/crypto-iv
100  TITLE:=CryptoAPI initialization vectors
101  DEPENDS:=+kmod-crypto-rng +kmod-crypto-wq
102  KCONFIG:= CONFIG_CRYPTO_BLKCIPHER2
103  FILES:= \
104        $(LINUX_DIR)/crypto/eseqiv.ko \
105        $(LINUX_DIR)/crypto/chainiv.ko
106  AUTOLOAD:=$(call AutoLoad,10,eseqiv chainiv)
107  $(call AddDepends/crypto)
108endef
109$(eval $(call KernelPackage,crypto-iv))
110
111define KernelPackage/crypto-hw-padlock
112  TITLE:=VIA PadLock ACE with AES/SHA hw crypto module
113  DEPENDS:=+kmod-crypto-aes
114  KCONFIG:= \
115        CONFIG_CRYPTO_DEV_PADLOCK \
116        CONFIG_CRYPTO_DEV_PADLOCK_AES \
117        CONFIG_CRYPTO_DEV_PADLOCK_SHA
118  FILES:= \
119        $(LINUX_DIR)/drivers/crypto/padlock-aes.ko \
120        $(LINUX_DIR)/drivers/crypto/padlock-sha.ko
121  AUTOLOAD:=$(call AutoLoad,09,padlock-aes padlock-sha)
122  $(call AddDepends/crypto)
123endef
124
125$(eval $(call KernelPackage,crypto-hw-padlock))
126
127
128define KernelPackage/crypto-hw-geode
129  TITLE:=AMD Geode hardware crypto module
130  KCONFIG:= \
131        CONFIG_CRYPTO_DEV_GEODE
132  FILES:=$(LINUX_DIR)/drivers/crypto/geode-aes.ko
133  AUTOLOAD:=$(call AutoLoad,09,geode-aes)
134  $(call AddDepends/crypto)
135endef
136
137$(eval $(call KernelPackage,crypto-hw-geode))
138
139
140define KernelPackage/crypto-hw-hifn-795x
141  TITLE:=HIFN 795x crypto accelerator
142  DEPENDS:=@!TARGET_ubicom32
143  KCONFIG:= \
144        CONFIG_HW_RANDOM=y \
145        CONFIG_CRYPTO_DEV_HIFN_795X \
146        CONFIG_CRYPTO_DEV_HIFN_795X_RNG=y
147  FILES:=$(LINUX_DIR)/drivers/crypto/hifn_795x.ko
148  AUTOLOAD:=$(call AutoLoad,09,hifn_795x)
149  $(call AddDepends/crypto,+kmod-crypto-des)
150endef
151
152$(eval $(call KernelPackage,crypto-hw-hifn-795x))
153
154
155define KernelPackage/crypto-hw-ixp4xx
156  TITLE:=Intel IXP4xx hardware crypto module
157  DEPENDS:=@TARGET_ixp4xx
158  KCONFIG:= \
159        CONFIG_CRYPTO_DEV_IXP4XX
160  FILES:=$(LINUX_DIR)/drivers/crypto/ixp4xx_crypto.ko
161  AUTOLOAD:=$(call AutoLoad,90,ixp4xx_crypto)
162  $(call AddDepends/crypto,+kmod-crypto-authenc +kmod-crypto-des)
163endef
164
165define KernelPackage/crypto-hw-ixp4xx/description
166  Kernel support for the Intel IXP4xx HW crypto engine.
167endef
168
169$(eval $(call KernelPackage,crypto-hw-ixp4xx))
170
171
172define KernelPackage/crypto-hw-ppc4xx
173  TITLE:=AMCC PPC4xx hardware crypto module
174  DEPENDS:=@TARGET_ppc40x||TARGET_ppc44x
175  KCONFIG:= \
176        CONFIG_CRYPTO_DEV_PPC4XX
177  FILES:=$(LINUX_DIR)/drivers/crypto/amcc/crypto4xx.ko
178  AUTOLOAD:=$(call AutoLoad,90,crypto4xx)
179  $(call AddDepends/crypto)
180endef
181
182define KernelPackage/crypto-hw-ppc4xx/description
183  Kernel support for the AMCC PPC4xx HW crypto engine.
184endef
185
186$(eval $(call KernelPackage,crypto-hw-ppc4xx))
187
188
189define KernelPackage/crypto-aes
190  TITLE:=AES cipher CryptoAPI module
191  KCONFIG:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
192  FILES:=$(LINUX_DIR)/crypto/aes$(AES_SUFFIX).ko
193  AUTOLOAD:=$(call AutoLoad,09,aes$(AES_SUFFIX))
194  $(call AddDepends/crypto)
195endef
196
197define KernelPackage/crypto-aes/x86
198  FILES+=$(LINUX_DIR)/arch/x86/crypto/aes-i586.ko
199  AUTOLOAD:=$(call AutoLoad,09,aes$(AES_SUFFIX) aes-i586)
200endef
201
202$(eval $(call KernelPackage,crypto-aes))
203
204
205define KernelPackage/crypto-arc4
206  TITLE:=ARC4 (RC4) cipher CryptoAPI module
207  KCONFIG:=CONFIG_CRYPTO_ARC4
208  FILES:=$(LINUX_DIR)/crypto/arc4.ko
209  AUTOLOAD:=$(call AutoLoad,09,arc4)
210  $(call AddDepends/crypto)
211endef
212
213$(eval $(call KernelPackage,crypto-arc4))
214
215
216define KernelPackage/crypto-authenc
217  TITLE:=Combined mode wrapper for IPsec
218  DEPENDS:=+kmod-crypto-manager
219  KCONFIG:=CONFIG_CRYPTO_AUTHENC
220  FILES:=$(LINUX_DIR)/crypto/authenc.ko
221  AUTOLOAD:=$(call AutoLoad,09,authenc)
222  $(call AddDepends/crypto)
223endef
224
225$(eval $(call KernelPackage,crypto-authenc))
226
227define KernelPackage/crypto-cbc
228  TITLE:=Cipher Block Chaining CryptoAPI module
229  DEPENDS:=+kmod-crypto-manager
230  KCONFIG:=CONFIG_CRYPTO_CBC
231  FILES:=$(LINUX_DIR)/crypto/cbc.ko
232  AUTOLOAD:=$(call AutoLoad,09,cbc)
233  $(call AddDepends/crypto)
234endef
235
236$(eval $(call KernelPackage,crypto-cbc))
237
238define KernelPackage/crypto-des
239  TITLE:=DES/3DES cipher CryptoAPI module
240  KCONFIG:=CONFIG_CRYPTO_DES
241  FILES:=$(LINUX_DIR)/crypto/des$(DES_SUFFIX).ko
242  AUTOLOAD:=$(call AutoLoad,09,des$(DES_SUFFIX))
243  $(call AddDepends/crypto)
244endef
245
246$(eval $(call KernelPackage,crypto-des))
247
248define KernelPackage/crypto-deflate
249  TITLE:=Deflate compression CryptoAPI module
250  DEPENDS:=+kmod-zlib
251  KCONFIG:=CONFIG_CRYPTO_DEFLATE
252  FILES:=$(LINUX_DIR)/crypto/deflate.ko
253  AUTOLOAD:=$(call AutoLoad,09,deflate)
254  $(call AddDepends/crypto)
255endef
256
257$(eval $(call KernelPackage,crypto-deflate))
258
259define KernelPackage/crypto-ecb
260  TITLE:=Electronic CodeBook CryptoAPI module
261  DEPENDS:=+kmod-crypto-manager
262  KCONFIG:=CONFIG_CRYPTO_ECB
263  FILES:=$(LINUX_DIR)/crypto/ecb.ko
264  AUTOLOAD:=$(call AutoLoad,09,ecb)
265  $(call AddDepends/crypto)
266endef
267
268$(eval $(call KernelPackage,crypto-ecb))
269
270
271define KernelPackage/crypto-hmac
272  TITLE:=HMAC digest CryptoAPI module
273  DEPENDS:=+kmod-crypto-hash
274  KCONFIG:=CONFIG_CRYPTO_HMAC
275  FILES:=$(LINUX_DIR)/crypto/hmac.ko
276  DEPENDS:=+kmod-crypto-manager
277  AUTOLOAD:=$(call AutoLoad,09,hmac)
278  $(call AddDepends/crypto)
279endef
280
281$(eval $(call KernelPackage,crypto-hmac))
282
283
284define KernelPackage/crypto-md5
285  TITLE:=MD5 digest CryptoAPI module
286  DEPENDS:=+kmod-crypto-hash
287  KCONFIG:=CONFIG_CRYPTO_MD5
288  FILES:=$(LINUX_DIR)/crypto/md5.ko
289  AUTOLOAD:=$(call AutoLoad,09,md5)
290  $(call AddDepends/crypto)
291endef
292
293$(eval $(call KernelPackage,crypto-md5))
294
295
296define KernelPackage/crypto-michael-mic
297  TITLE:=Michael MIC keyed digest CryptoAPI module
298  DEPENDS:=+kmod-crypto-hash
299  KCONFIG:=CONFIG_CRYPTO_MICHAEL_MIC
300  FILES:=$(LINUX_DIR)/crypto/michael_mic.ko
301  AUTOLOAD:=$(call AutoLoad,09,michael_mic)
302  $(call AddDepends/crypto)
303endef
304
305$(eval $(call KernelPackage,crypto-michael-mic))
306
307
308define KernelPackage/crypto-sha1
309  TITLE:=SHA1 digest CryptoAPI module
310  DEPENDS:=+kmod-crypto-hash
311  KCONFIG:=CONFIG_CRYPTO_SHA1
312  FILES:=$(LINUX_DIR)/crypto/sha1$(SHA1_SUFFIX).ko
313  AUTOLOAD:=$(call AutoLoad,09,sha1$(SHA1_SUFFIX))
314  $(call AddDepends/crypto)
315endef
316
317$(eval $(call KernelPackage,crypto-sha1))
318
319
320define KernelPackage/crypto-misc
321  TITLE:=Other CryptoAPI modules
322  DEPENDS:=+kmod-crypto-manager
323  KCONFIG:= \
324        CONFIG_CRYPTO_ANUBIS \
325        CONFIG_CRYPTO_BLOWFISH \
326        CONFIG_CRYPTO_CAMELLIA \
327        CONFIG_CRYPTO_CAST5 \
328        CONFIG_CRYPTO_CAST6 \
329        CONFIG_CRYPTO_CRC32C \
330        CONFIG_CRYPTO_FCRYPT \
331        CONFIG_CRYPTO_KHAZAD \
332        CONFIG_CRYPTO_MD4 \
333        CONFIG_CRYPTO_SERPENT \
334        CONFIG_CRYPTO_SHA256 \
335        CONFIG_CRYPTO_SHA512 \
336        CONFIG_CRYPTO_TEA \
337        CONFIG_CRYPTO_TGR192 \
338        CONFIG_CRYPTO_TWOFISH \
339        CONFIG_CRYPTO_TWOFISH_COMMON \
340        CONFIG_CRYPTO_TWOFISH_586 \
341        CONFIG_CRYPTO_WP512
342  FILES:= \
343        $(LINUX_DIR)/crypto/anubis.ko \
344        $(LINUX_DIR)/crypto/blowfish.ko \
345        $(LINUX_DIR)/crypto/cast5.ko \
346        $(LINUX_DIR)/crypto/cast6.ko \
347        $(LINUX_DIR)/crypto/khazad.ko \
348        $(LINUX_DIR)/crypto/md4.ko \
349        $(LINUX_DIR)/crypto/serpent.ko \
350        $(LINUX_DIR)/crypto/sha256$(SHA256_SUFFIX).ko \
351        $(LINUX_DIR)/crypto/sha512$(SHA512_SUFFIX).ko \
352        $(LINUX_DIR)/crypto/tea.ko \
353        $(LINUX_DIR)/crypto/wp512.ko
354  ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),le,2.6.35)),1)
355    FILES += $(LINUX_DIR)/crypto/twofish.ko
356  else
357    FILES += $(LINUX_DIR)/crypto/twofish_generic.ko
358  endif
359  $(call AddDepends/crypto)
360endef
361
362define KernelPackage/crypto-misc/2.6
363  FILES+= \
364        $(LINUX_DIR)/crypto/camellia.ko \
365        $(if $(findstring y,$(CONFIG_CRYPTO_CRC32C)),,$(LINUX_DIR)/crypto/crc32c.ko) \
366        $(LINUX_DIR)/crypto/fcrypt.ko \
367        $(LINUX_DIR)/crypto/tgr192.ko \
368        $(LINUX_DIR)/crypto/twofish_common.ko
369endef
370
371define KernelPackage/crypto-misc/x86
372  FILES+=$(LINUX_DIR)/arch/x86/crypto/twofish-i586.ko
373endef
374
375$(eval $(call KernelPackage,crypto-misc))
376
377
378define KernelPackage/crypto-ocf
379  TITLE:=OCF modules
380  DEPENDS:=+@OPENSSL_ENGINE @!TARGET_uml +kmod-crypto-manager
381  KCONFIG:= \
382        CONFIG_OCF_OCF \
383        CONFIG_OCF_CRYPTODEV \
384        CONFIG_OCF_CRYPTOSOFT \
385        CONFIG_OCF_FIPS=y \
386        CONFIG_OCF_RANDOMHARVEST=y
387  FILES:= \
388        $(LINUX_DIR)/crypto/ocf/ocf.ko \
389        $(LINUX_DIR)/crypto/ocf/cryptodev.ko \
390        $(LINUX_DIR)/crypto/ocf/cryptosoft.ko
391  AUTOLOAD:=$(call AutoLoad,09, \
392        ocf \
393        cryptodev \
394        cryptosoft \
395  )
396  $(call AddDepends/crypto)
397endef
398
399$(eval $(call KernelPackage,crypto-ocf))
400
401
402define KernelPackage/crypto-ocf-hifn7751
403  TITLE:=OCF support for Hifn 6500/7751/7811/795x, Invertex AEON and NetSec 7751 devices
404  DEPENDS:=+@OPENSSL_ENGINE @PCI_SUPPORT @!TARGET_uml kmod-crypto-ocf
405  KCONFIG:=CONFIG_OCF_HIFN
406  FILES:=$(LINUX_DIR)/crypto/ocf/hifn/hifn7751.ko
407  AUTOLOAD:=$(call AutoLoad,10,hifn7751)
408  $(call AddDepends/crypto)
409endef
410
411$(eval $(call KernelPackage,crypto-ocf-hifn7751))
412
413
414define KernelPackage/crypto-ocf-hifnhipp
415  TITLE:=OCF support for Hifn 7855/8155 devices
416  DEPENDS:=+@OPENSSL_ENGINE @PCI_SUPPORT @!TARGET_uml kmod-crypto-ocf
417  KCONFIG:=CONFIG_OCF_HIFNHIPP
418  FILES:=$(LINUX_DIR)/crypto/ocf/hifn/hifnHIPP.ko
419  AUTOLOAD:=$(call AutoLoad,10,hifnhipp)
420  $(call AddDepends/crypto)
421endef
422
423$(eval $(call KernelPackage,crypto-ocf-hifnhipp))
424
425
426define KernelPackage/crypto-null
427  TITLE:=Null CryptoAPI module
428  KCONFIG:=CONFIG_CRYPTO_NULL
429  FILES:=$(LINUX_DIR)/crypto/crypto_null.ko
430  AUTOLOAD:=$(call AutoLoad,09,crypto_null)
431  $(call AddDepends/crypto)
432endef
433
434$(eval $(call KernelPackage,crypto-null))
435
436
437define KernelPackage/crypto-test
438  TITLE:=Test CryptoAPI module
439  KCONFIG:=CONFIG_CRYPTO_TEST
440  FILES:=$(LINUX_DIR)/crypto/tcrypt.ko
441  $(call AddDepends/crypto)
442endef
443
444$(eval $(call KernelPackage,crypto-test))
445
446
447define KernelPackage/crypto-xts
448  TITLE:=XTS cipher CryptoAPI module
449  DEPENDS:=+kmod-crypto-manager
450  KCONFIG:= \
451        CONFIG_CRYPTO_GF128MUL \
452        CONFIG_CRYPTO_XTS
453  FILES:= \
454        $(LINUX_DIR)/crypto/xts.ko \
455        $(LINUX_DIR)/crypto/gf128mul.ko
456  AUTOLOAD:=$(call AutoLoad,09, \
457        gf128mul \
458        xts \
459  )
460  $(call AddDepends/crypto)
461endef
462
463$(eval $(call KernelPackage,crypto-xts))
464
465define KernelPackage/crypto-mv-cesa
466  TITLE:=Marvell crypto engine
467  DEPENDS:=+kmod-crypto-manager @TARGET_kirkwood||TARGET_orion
468  KCONFIG:=CONFIG_CRYPTO_DEV_MV_CESA
469  FILES:=$(LINUX_DIR)/drivers/crypto/mv_cesa.ko
470  AUTOLOAD:=$(call AutoLoad,09,mv_cesa)
471  $(call AddDepends/crypto)
472endef
473
474$(eval $(call KernelPackage,crypto-mv-cesa))
Note: See TracBrowser for help on using the repository browser.