···1313 *1414 */15151616-#include <linux/crypto.h>1616+#include <crypto/internal/hash.h>1717#include "sha.h"1818#include "crypt_s390.h"19192020-void s390_sha_update(struct crypto_tfm *tfm, const u8 *data, unsigned int len)2020+int s390_sha_update(struct shash_desc *desc, const u8 *data, unsigned int len)2121{2222- struct s390_sha_ctx *ctx = crypto_tfm_ctx(tfm);2323- unsigned int bsize = crypto_tfm_alg_blocksize(tfm);2222+ struct s390_sha_ctx *ctx = shash_desc_ctx(desc);2323+ unsigned int bsize = crypto_shash_blocksize(desc->tfm);2424 unsigned int index;2525 int ret;2626···5151store:5252 if (len)5353 memcpy(ctx->buf + index , data, len);5454+5555+ return 0;5456}5557EXPORT_SYMBOL_GPL(s390_sha_update);56585757-void s390_sha_final(struct crypto_tfm *tfm, u8 *out)5959+int s390_sha_final(struct shash_desc *desc, u8 *out)5860{5959- struct s390_sha_ctx *ctx = crypto_tfm_ctx(tfm);6060- unsigned int bsize = crypto_tfm_alg_blocksize(tfm);6161+ struct s390_sha_ctx *ctx = shash_desc_ctx(desc);6262+ unsigned int bsize = crypto_shash_blocksize(desc->tfm);6163 u64 bits;6264 unsigned int index, end, plen;6365 int ret;···8987 BUG_ON(ret != end);90889189 /* copy digest to out */9292- memcpy(out, ctx->state, crypto_hash_digestsize(crypto_hash_cast(tfm)));9090+ memcpy(out, ctx->state, crypto_shash_digestsize(desc->tfm));9391 /* wipe context */9492 memset(ctx, 0, sizeof *ctx);9393+9494+ return 0;9595}9696EXPORT_SYMBOL_GPL(s390_sha_final);9797
+3-3
drivers/crypto/Kconfig
···8686config CRYPTO_SHA1_S3908787 tristate "SHA1 digest algorithm"8888 depends on S3908989- select CRYPTO_ALGAPI8989+ select CRYPTO_HASH9090 help9191 This is the s390 hardware accelerated implementation of the9292 SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2).···9494config CRYPTO_SHA256_S3909595 tristate "SHA256 digest algorithm"9696 depends on S3909797- select CRYPTO_ALGAPI9797+ select CRYPTO_HASH9898 help9999 This is the s390 hardware accelerated implementation of the100100 SHA256 secure hash standard (DFIPS 180-2).···105105config CRYPTO_SHA512_S390106106 tristate "SHA384 and SHA512 digest algorithm"107107 depends on S390108108- select CRYPTO_ALGAPI108108+ select CRYPTO_HASH109109 help110110 This is the s390 hardware accelerated implementation of the111111 SHA512 secure hash standard.