kernel: crypto: crypto-rng: select SHA512 for >= 5.14.0
[openwrt/staging/dedeckeh.git] / package / kernel / linux / modules / crypto.mk
index a5b018aa1e82b91a318d8cb819fa92139f91dd63..98bcb9e874701195ffc9b25c6628077079f542f0 100644 (file)
@@ -52,6 +52,7 @@ $(eval $(call KernelPackage,crypto-aead))
 
 define KernelPackage/crypto-arc4
   TITLE:=ARC4 cipher CryptoAPI module
+  DEPENDS:=+kmod-crypto-user
   KCONFIG:= \
          CONFIG_CRYPTO_ARC4 \
          CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y
@@ -239,6 +240,18 @@ endef
 $(eval $(call KernelPackage,crypto-echainiv))
 
 
+define KernelPackage/crypto-essiv
+  TITLE:=ESSIV support for block encryption
+  DEPENDS:=+kmod-crypto-authenc
+  KCONFIG:=CONFIG_CRYPTO_ESSIV
+  FILES:= $(LINUX_DIR)/crypto/essiv.ko
+  AUTOLOAD:=$(call AutoLoad,10,essiv)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-essiv))
+
+
 define KernelPackage/crypto-fcrypt
   TITLE:=FCRYPT cipher CryptoAPI module
   KCONFIG:=CONFIG_CRYPTO_FCRYPT
@@ -529,7 +542,7 @@ define KernelPackage/crypto-lib-curve25519/config
   imply PACKAGE_kmod-crypto-kpp
 endef
 
-define KernelPackage/crypto-lib-curve25519/x86/64
+define KernelPackage/crypto-lib-curve25519/x86_64
   KCONFIG+=CONFIG_CRYPTO_CURVE25519_X86
   FILES+=$(LINUX_DIR)/arch/x86/crypto/curve25519-x86_64.ko
 endef
@@ -544,6 +557,11 @@ ifeq ($(ARCH)-$(CONFIG_KERNEL_MODE_NEON),arm-y)
          $(KernelPackage/crypto-lib-curve25519/arm-neon)
 endif
 
+ifdef KernelPackage/crypto-lib-curve25519/$(ARCH)
+  KernelPackage/crypto-lib-curve25519/$(CRYPTO_TARGET)=\
+         $(KernelPackage/crypto-lib-curve25519/$(ARCH))
+endif
+
 $(eval $(call KernelPackage,crypto-lib-curve25519))
 
 
@@ -622,7 +640,8 @@ define KernelPackage/crypto-md5
   DEPENDS:=+kmod-crypto-hash
   KCONFIG:= \
        CONFIG_CRYPTO_MD5 \
-       CONFIG_CRYPTO_MD5_OCTEON
+       CONFIG_CRYPTO_MD5_OCTEON \
+       CONFIG_CRYPTO_MD5_PPC
   FILES:=$(LINUX_DIR)/crypto/md5.ko
   AUTOLOAD:=$(call AutoLoad,09,md5)
   $(call AddDepends/crypto)
@@ -633,6 +652,16 @@ define KernelPackage/crypto-md5/octeon
   AUTOLOAD+=$(call AutoLoad,09,octeon-md5)
 endef
 
+define KernelPackage/crypto-md5/powerpc
+  FILES+=$(LINUX_DIR)/arch/powerpc/crypto/md5-ppc.ko
+  AUTOLOAD+=$(call AutoLoad,09,md5-ppc)
+endef
+
+ifdef KernelPackage/crypto-md5/$(ARCH)
+  KernelPackage/crypto-md5/$(CRYPTO_TARGET)=\
+         $(KernelPackage/crypto-md5/$(ARCH))
+endif
+
 $(eval $(call KernelPackage,crypto-md5))
 
 
@@ -650,7 +679,7 @@ $(eval $(call KernelPackage,crypto-michael-mic))
 
 define KernelPackage/crypto-misc
   TITLE:=Other CryptoAPI modules
-  DEPENDS:=+kmod-crypto-xts
+  DEPENDS:=+kmod-crypto-xts +kmod-crypto-user
   KCONFIG:= \
        CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y \
        CONFIG_CRYPTO_CAMELLIA_X86_64 \
@@ -709,15 +738,15 @@ ifndef CONFIG_TARGET_x86_64
     FILES+= \
        $(LINUX_DIR)/arch/x86/crypto/twofish-i586.ko \
        $(LINUX_DIR)/arch/x86/crypto/serpent-sse2-i586.ko \
-       $(LINUX_DIR)/arch/x86/crypto/glue_helper.ko \
+       $(LINUX_DIR)/arch/x86/crypto/glue_helper.ko@lt5.12 \
        $(LINUX_DIR)/crypto/cryptd.ko \
        $(LINUX_DIR)/crypto/crypto_simd.ko
-    AUTOLOAD+= $(call AutoLoad,10,cryptd glue_helper \
+    AUTOLOAD+= $(call AutoLoad,10,cryptd glue_helper@lt5.12 \
        serpent-sse2-i586 twofish-i586 blowfish_generic)
   endef
 endif
 
-define KernelPackage/crypto-misc/x86/64
+define KernelPackage/crypto-misc/x86_64
   FILES+= \
        $(LINUX_DIR)/arch/x86/crypto/camellia-x86_64.ko \
        $(LINUX_DIR)/arch/x86/crypto/blowfish-x86_64.ko \
@@ -737,6 +766,11 @@ define KernelPackage/crypto-misc/x86/64
        twofish-avx-x86_64 blowfish-x86_64 serpent-avx-x86_64 serpent-avx2)
 endef
 
+ifdef KernelPackage/crypto-misc/$(ARCH)
+  KernelPackage/crypto-misc/$(CRYPTO_TARGET)=\
+         $(KernelPackage/crypto-misc/$(ARCH))
+endif
+
 $(eval $(call KernelPackage,crypto-misc))
 
 
@@ -793,7 +827,9 @@ $(eval $(call KernelPackage,crypto-rmd160))
 
 define KernelPackage/crypto-rng
   TITLE:=CryptoAPI random number generation
-  DEPENDS:=+kmod-crypto-hash +kmod-crypto-hmac +kmod-crypto-sha256
+  DEPENDS:=+kmod-crypto-hash +kmod-crypto-hmac \
+               +LINUX_5_10:kmod-crypto-sha256 \
+               +LINUX_5_15:kmod-crypto-sha512
   KCONFIG:= \
        CONFIG_CRYPTO_DRBG \
        CONFIG_CRYPTO_DRBG_HMAC=y \
@@ -832,6 +868,7 @@ define KernelPackage/crypto-sha1
        CONFIG_CRYPTO_SHA1_ARM \
        CONFIG_CRYPTO_SHA1_ARM_NEON \
        CONFIG_CRYPTO_SHA1_OCTEON \
+       CONFIG_CRYPTO_SHA1_PPC_SPE \
        CONFIG_CRYPTO_SHA1_SSSE3
   FILES:=$(LINUX_DIR)/crypto/sha1_generic.ko
   AUTOLOAD:=$(call AutoLoad,09,sha1_generic)
@@ -858,13 +895,23 @@ define KernelPackage/crypto-sha1/octeon
   AUTOLOAD+=$(call AutoLoad,09,octeon-sha1)
 endef
 
-KernelPackage/crypto-sha1/tegra=$(KernelPakcage/crypto-sha1/arm)
+KernelPackage/crypto-sha1/tegra=$(KernelPackage/crypto-sha1/arm)
+
+define KernelPackage/crypto-sha1/mpc85xx
+  FILES+=$(LINUX_DIR)/arch/powerpc/crypto/sha1-ppc-spe.ko
+  AUTOLOAD+=$(call AutoLoad,09,sha1-ppc-spe)
+endef
 
-define KernelPackage/crypto-sha1/x86/64
+define KernelPackage/crypto-sha1/x86_64
   FILES+=$(LINUX_DIR)/arch/x86/crypto/sha1-ssse3.ko
   AUTOLOAD+=$(call AutoLoad,09,sha1-ssse3)
 endef
 
+ifdef KernelPackage/crypto-sha1/$(ARCH)
+  KernelPackage/crypto-sha1/$(CRYPTO_TARGET)=\
+         $(KernelPackage/crypto-sha1/$(ARCH))
+endif
+
 $(eval $(call KernelPackage,crypto-sha1))
 
 
@@ -874,6 +921,7 @@ define KernelPackage/crypto-sha256
   KCONFIG:= \
        CONFIG_CRYPTO_SHA256 \
        CONFIG_CRYPTO_SHA256_OCTEON \
+       CONFIG_CRYPTO_SHA256_PPC_SPE \
        CONFIG_CRYPTO_SHA256_SSSE3
   FILES:= \
        $(LINUX_DIR)/crypto/sha256_generic.ko \
@@ -887,11 +935,21 @@ define KernelPackage/crypto-sha256/octeon
   AUTOLOAD+=$(call AutoLoad,09,octeon-sha256)
 endef
 
-define KernelPackage/crypto-sha256/x86/64
+define KernelPackage/crypto-sha256/mpc85xx
+  FILES+=$(LINUX_DIR)/arch/powerpc/crypto/sha256-ppc-spe.ko
+  AUTOLOAD+=$(call AutoLoad,09,sha256-ppc-spe)
+endef
+
+define KernelPackage/crypto-sha256/x86_64
   FILES+=$(LINUX_DIR)/arch/x86/crypto/sha256-ssse3.ko
   AUTOLOAD+=$(call AutoLoad,09,sha256-ssse3)
 endef
 
+ifdef KernelPackage/crypto-sha256/$(ARCH)
+  KernelPackage/crypto-sha256/$(CRYPTO_TARGET)=\
+         $(KernelPackage/crypto-sha256/$(ARCH))
+endif
+
 $(eval $(call KernelPackage,crypto-sha256))
 
 
@@ -924,11 +982,16 @@ endef
 
 KernelPackage/crypto-sha512/tegra=$(KernelPackage/crypto-sha512/arm)
 
-define KernelPackage/crypto-sha512/x86/64
+define KernelPackage/crypto-sha512/x86_64
   FILES+=$(LINUX_DIR)/arch/x86/crypto/sha512-ssse3.ko
   AUTOLOAD+=$(call AutoLoad,09,sha512-ssse3)
 endef
 
+ifdef KernelPackage/crypto-sha512/$(ARCH)
+  KernelPackage/crypto-sha512/$(CRYPTO_TARGET)=\
+         $(KernelPackage/crypto-sha512/$(ARCH))
+endif
+
 $(eval $(call KernelPackage,crypto-sha512))