s390: sha256 support.
Subsystems (3)
PATCH 8/17 s390: sha256 support.
From: Jan Glauber <[email protected]>
[patch 8/17] s390: sha256 support.
Add support for the hardware accelerated sha256 crypto algorithm.
Signed-off-by Jan Glauber <[email protected]>
Signed-off-by Martin Schwidefsky <[email protected]>
---
arch/s390/crypto/Makefile | 1 arch/s390/crypto/crypt_s390.h | 2 arch/s390/crypto/crypt_s390_query.c | 6 + arch/s390/crypto/sha256_s390.c | 151 ++++++++++++++++++++++++++++++++++++ arch/s390/defconfig | 1 crypto/Kconfig | 11 ++ 6 files changed, 171 insertions(+), 1 deletion(-)
arch/s390/crypto/crypt_s390.h +2 -0
@@ -61,6 +61,7 @@ enum crypt_s390_kmc_func {enum crypt_s390_kimd_func {KIMD_QUERY =CRYPT_S390_KIMD |0 ,KIMD_SHA_1 =CRYPT_S390_KIMD |1 , +KIMD_SHA_256 =CRYPT_S390_KIMD |2 , };/* function codes for KLMD (COMPUTE LAST MESSAGE DIGEST)
@@ -69,6 +70,7 @@ enum crypt_s390_kimd_func {enum crypt_s390_klmd_func {KLMD_QUERY =CRYPT_S390_KLMD |0 ,KLMD_SHA_1 =CRYPT_S390_KLMD |1 , +KLMD_SHA_256 =CRYPT_S390_KLMD |2 , };/* function codes for KMAC (COMPUTE MESSAGE AUTHENTICATION CODE)
arch/s390/crypto/crypt_s390_query.c +5 -1
@@ -48,16 +48,20 @@ static void query_available_functions(vo crypt_s390_func_available(KIMD_QUERY));printk (KERN_INFO "KIMD_SHA_1: %d\n" ,crypt_s390_func_available (KIMD_SHA_1 )); +printk (KERN_INFO "KIMD_SHA_256: %d\n" , +crypt_s390_func_available (KIMD_SHA_256 ));/* query available KLMD functions */ printk (KERN_INFO "KLMD_QUERY: %d\n" ,crypt_s390_func_available (KLMD_QUERY ));printk (KERN_INFO "KLMD_SHA_1: %d\n" ,crypt_s390_func_available (KLMD_SHA_1 )); +printk (KERN_INFO "KLMD_SHA_256: %d\n" , +crypt_s390_func_available (KLMD_SHA_256 ));/* query available KMAC functions */ printk (KERN_INFO "KMAC_QUERY: %d\n" , -crypt_s3990_func_available (KMAC_QUERY )); +crypt_s390_func_available (KMAC_QUERY ));printk (KERN_INFO "KMAC_DEA: %d\n" ,crypt_s390_func_available (KMAC_DEA )); printk(KERN_INFO "KMAC_TDEA_128: %d\n",
arch/s390/crypto/Makefile +1 -0
@@ -3,6 +3,7 @@ # obj-$(CONFIG_CRYPTO_SHA1_S390) += sha1_s390.o +obj-$(CONFIG_CRYPTO_SHA256_S390) += sha256_s390.o obj-$(CONFIG_CRYPTO_DES_S390) += des_s390.o des_check_key.o obj-$(CONFIG_CRYPTO_TEST) += crypt_s390_query.o
arch/s390/crypto/sha256_s390.c +151 -0
151 lines not on this page · raw message
arch/s390/defconfig +1 -0
@@ -634,6 +634,7 @@ CONFIG_CRYPTO=y # CONFIG_CRYPTO_SHA1 is not set # CONFIG_CRYPTO_SHA1_S390 is not set # CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_SHA256_S390 is not set # CONFIG_CRYPTO_SHA512 is not set # CONFIG_CRYPTO_WP512 is not set # CONFIG_CRYPTO_TGR192 is not set
crypto/Kconfig +11 -0
@@ -44,6 +44,7 @@ config CRYPTO_SHA1_S390 tristate "SHA1 digest algorithm (s390)" depends on CRYPTO && ARCH_S390 help + This is the s390 hardware accelerated implementation of the SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2). config CRYPTO_SHA256
@@ -55,6 +56,16 @@ config CRYPTO_SHA256 This version of SHA implements a 256 bit hash with 128 bits of security against collision attacks. +config CRYPTO_SHA256_S390 + tristate "SHA256 digest algorithm (s390)" + depends on CRYPTO && ARCH_S390 + help + This is the s390 hardware accelerated implementation of the + SHA256 secure hash standard (DFIPS 180-2). + + This version of SHA implements a 256 bit hash with 128 bits of + security against collision attacks. + config CRYPTO_SHA512 tristate "SHA384 and SHA512 digest algorithms" depends on CRYPTO