linux: convert CompareKernelPatchVer to version tagged symbols
[openwrt/svn-archive/archive.git] / package / kernel / linux / modules / crypto.mk
index 3193fb031a0726a9ceeb4367e95b3f63b9d16a64..4df2d7393acb27265c0d1e6c2c1668ed3b00e4d6 100644 (file)
@@ -303,6 +303,17 @@ endef
 
 $(eval $(call KernelPackage,crypto-cbc))
 
 
 $(eval $(call KernelPackage,crypto-cbc))
 
+define KernelPackage/crypto-ctr
+  TITLE:=Counter Mode CryptoAPI module
+  DEPENDS:=+kmod-crypto-manager +kmod-crypto-seqiv
+  KCONFIG:=CONFIG_CRYPTO_CTR
+  FILES:=$(LINUX_DIR)/crypto/ctr.ko
+  AUTOLOAD:=$(call AutoLoad,09,ctr)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-ctr))
+
 define KernelPackage/crypto-pcbc
   TITLE:=Propagating Cipher Block Chaining CryptoAPI module
   DEPENDS:=+kmod-crypto-manager
 define KernelPackage/crypto-pcbc
   TITLE:=Propagating Cipher Block Chaining CryptoAPI module
   DEPENDS:=+kmod-crypto-manager
@@ -318,13 +329,10 @@ define KernelPackage/crypto-crc32c
   TITLE:=CRC32c CRC module
   DEPENDS:=+kmod-crypto-hash
   KCONFIG:=CONFIG_CRYPTO_CRC32C
   TITLE:=CRC32c CRC module
   DEPENDS:=+kmod-crypto-hash
   KCONFIG:=CONFIG_CRYPTO_CRC32C
-ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,3.15.0)),1)
-  FILES:=$(LINUX_DIR)/crypto/crc32c_generic.ko
-  AUTOLOAD:=$(call AutoLoad,04,crc32c_generic,1)
-else
-  FILES:=$(LINUX_DIR)/crypto/crc32c.ko
-  AUTOLOAD:=$(call AutoLoad,04,crc32c,1)
-endif
+  FILES:= \
+       $(LINUX_DIR)/crypto/crc32c.ko@lt3.15 \
+       $(LINUX_DIR)/crypto/crc32c_generic.ko@ge3.15
+  AUTOLOAD:=$(call AutoLoad,04,crc32c@lt3.15 crc32c_generic@ge3.15,1)
   $(call AddDepends/crypto)
 endef
 
   $(call AddDepends/crypto)
 endef
 
@@ -389,6 +397,41 @@ endef
 $(eval $(call KernelPackage,crypto-hmac))
 
 
 $(eval $(call KernelPackage,crypto-hmac))
 
 
+define KernelPackage/crypto-gcm
+  TITLE:=GCM/GMAC CryptoAPI module
+  DEPENDS:=+kmod-crypto-ctr +kmod-crypto-ghash +kmod-crypto-null
+  KCONFIG:=CONFIG_CRYPTO_GCM
+  FILES:=$(LINUX_DIR)/crypto/gcm.ko
+  AUTOLOAD:=$(call AutoLoad,09,gcm)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-gcm))
+
+
+define KernelPackage/crypto-gf128
+  TITLE:=GF(2^128) multiplication functions CryptoAPI module
+  KCONFIG:=CONFIG_CRYPTO_GF128MUL
+  FILES:=$(LINUX_DIR)/crypto/gf128mul.ko
+  AUTOLOAD:=$(call AutoLoad,09,gf128mul)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-gf128))
+
+
+define KernelPackage/crypto-ghash
+  TITLE:=GHASH digest CryptoAPI module
+  DEPENDS:=+kmod-crypto-gf128 +kmod-crypto-hash
+  KCONFIG:=CONFIG_CRYPTO_GHASH
+  FILES:=$(LINUX_DIR)/crypto/ghash-generic.ko
+  AUTOLOAD:=$(call AutoLoad,09,ghash-generic)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-ghash))
+
+
 define KernelPackage/crypto-md4
   TITLE:=MD4 digest CryptoAPI module
   DEPENDS:=+kmod-crypto-hash
 define KernelPackage/crypto-md4
   TITLE:=MD4 digest CryptoAPI module
   DEPENDS:=+kmod-crypto-hash
@@ -449,13 +492,6 @@ endef
 $(eval $(call KernelPackage,crypto-sha256))
 
 
 $(eval $(call KernelPackage,crypto-sha256))
 
 
-ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,3.6.0)),1)
-camellia_mod_suffix=_generic
-endif
-ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,3.7.0)),1)
-cast56_mod_suffix=_generic
-endif
-
 define KernelPackage/crypto-misc
   TITLE:=Other CryptoAPI modules
   DEPENDS:=+kmod-crypto-manager
 define KernelPackage/crypto-misc
   TITLE:=Other CryptoAPI modules
   DEPENDS:=+kmod-crypto-manager
@@ -477,10 +513,10 @@ define KernelPackage/crypto-misc
        CONFIG_CRYPTO_WP512
   FILES:= \
        $(LINUX_DIR)/crypto/anubis.ko \
        CONFIG_CRYPTO_WP512
   FILES:= \
        $(LINUX_DIR)/crypto/anubis.ko \
-       $(LINUX_DIR)/crypto/camellia$(camellia_mod_suffix).ko \
-       $(if $(call kernel_patchver_ge,3.7),$(LINUX_DIR)/crypto/cast_common.ko) \
-       $(LINUX_DIR)/crypto/cast5$(cast56_mod_suffix).ko \
-       $(LINUX_DIR)/crypto/cast6$(cast56_mod_suffix).ko \
+       $(LINUX_DIR)/crypto/camellia_generic.ko \
+       $(LINUX_DIR)/crypto/cast_common.ko \
+       $(LINUX_DIR)/crypto/cast5_generic.ko \
+       $(LINUX_DIR)/crypto/cast6_generic.ko \
        $(LINUX_DIR)/crypto/khazad.ko \
        $(LINUX_DIR)/crypto/sha512_generic.ko \
        $(LINUX_DIR)/crypto/tea.ko \
        $(LINUX_DIR)/crypto/khazad.ko \
        $(LINUX_DIR)/crypto/sha512_generic.ko \
        $(LINUX_DIR)/crypto/tea.ko \
@@ -572,17 +608,10 @@ $(eval $(call KernelPackage,crypto-test))
 
 define KernelPackage/crypto-xts
   TITLE:=XTS cipher CryptoAPI module
 
 define KernelPackage/crypto-xts
   TITLE:=XTS cipher CryptoAPI module
-  DEPENDS:=+kmod-crypto-manager
-  KCONFIG:= \
-       CONFIG_CRYPTO_GF128MUL \
-       CONFIG_CRYPTO_XTS
-  FILES:= \
-       $(LINUX_DIR)/crypto/xts.ko \
-       $(LINUX_DIR)/crypto/gf128mul.ko
-  AUTOLOAD:=$(call AutoLoad,09, \
-       gf128mul \
-       xts \
-  )
+  DEPENDS:=+kmod-crypto-gf128 +kmod-crypto-manager
+  KCONFIG:=CONFIG_CRYPTO_XTS
+  FILES:=$(LINUX_DIR)/crypto/xts.ko
+  AUTOLOAD:=$(call AutoLoad,09,xts)
   $(call AddDepends/crypto)
 endef
 
   $(call AddDepends/crypto)
 endef