0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef _CRYPTO_ARCH_S390_SHA_H
0011 #define _CRYPTO_ARCH_S390_SHA_H
0012
0013 #include <linux/crypto.h>
0014 #include <crypto/sha1.h>
0015 #include <crypto/sha2.h>
0016 #include <crypto/sha3.h>
0017
0018
0019 #define SHA3_STATE_SIZE 200
0020 #define CPACF_MAX_PARMBLOCK_SIZE SHA3_STATE_SIZE
0021 #define SHA_MAX_BLOCK_SIZE SHA3_224_BLOCK_SIZE
0022
0023 struct s390_sha_ctx {
0024 u64 count;
0025 u32 state[CPACF_MAX_PARMBLOCK_SIZE / sizeof(u32)];
0026 u8 buf[SHA_MAX_BLOCK_SIZE];
0027 int func;
0028 };
0029
0030 struct shash_desc;
0031
0032 int s390_sha_update(struct shash_desc *desc, const u8 *data, unsigned int len);
0033 int s390_sha_final(struct shash_desc *desc, u8 *out);
0034
0035 #endif