kernel: crypto: add SHA2(224 and 256) ARM64 CE optimized module
authorRobert Marko <robimarko@gmail.com>
Wed, 6 Mar 2024 17:38:28 +0000 (18:38 +0100)
committerRobert Marko <robimarko@gmail.com>
Wed, 6 Mar 2024 17:38:28 +0000 (18:38 +0100)
Kernel has optimized version of SHA2(224 and 256) using the ARMv8 Crypto
Extensions, so lets package it.

Use it by default for qualcommax as it uses Cortex-A53 core and has ARMv8
CE extensions present.

Signed-off-by: Robert Marko <robimarko@gmail.com>
package/kernel/linux/modules/crypto.mk

index 839e1bd45feeadbda027711e591ca5ddfdbc3961..f7ba0a7b2943c305b48fff478df55a23f05c33aa 100644 (file)
@@ -985,6 +985,7 @@ define KernelPackage/crypto-sha256
        CONFIG_CRYPTO_SHA256_OCTEON \
        CONFIG_CRYPTO_SHA256_PPC_SPE \
        CONFIG_CRYPTO_SHA256_ARM64 \
+       CONFIG_CRYPTO_SHA2_ARM64_CE \
        CONFIG_CRYPTO_SHA256_SSSE3
   FILES:= \
        $(LINUX_DIR)/crypto/sha256_generic.ko \
@@ -998,6 +999,12 @@ define KernelPackage/crypto-sha256/aarch64
   AUTOLOAD+=$(call AutoLoad,09,sha256-arm64)
 endef
 
+define KernelPackage/crypto-sha256/aarch64-ce
+  $(call KernelPackage/crypto-sha256/aarch64)
+  FILES+=$(LINUX_DIR)/arch/arm64/crypto/sha2-ce.ko
+  AUTOLOAD+=$(call AutoLoad,09,sha2-ce)
+endef
+
 define KernelPackage/crypto-sha256/octeon
   FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha256.ko
   AUTOLOAD+=$(call AutoLoad,09,octeon-sha256)
@@ -1015,6 +1022,8 @@ define KernelPackage/crypto-sha256/x86_64
 endef
 endif
 
+KernelPackage/crypto-sha256/qualcommax=$(KernelPackage/crypto-sha256/aarch64-ce)
+
 ifdef KernelPackage/crypto-sha256/$(ARCH)
   KernelPackage/crypto-sha256/$(CRYPTO_TARGET)=\
          $(KernelPackage/crypto-sha256/$(ARCH))