.. | .. |
---|
12 | 12 | |
---|
13 | 13 | #include <linux/crypto.h> |
---|
14 | 14 | #include <crypto/sha.h> |
---|
| 15 | +#include <crypto/sha3.h> |
---|
15 | 16 | |
---|
16 | 17 | /* must be big enough for the largest SHA variant */ |
---|
17 | | -#define SHA_MAX_STATE_SIZE (SHA512_DIGEST_SIZE / 4) |
---|
18 | | -#define SHA_MAX_BLOCK_SIZE SHA512_BLOCK_SIZE |
---|
| 18 | +#define SHA3_STATE_SIZE 200 |
---|
| 19 | +#define CPACF_MAX_PARMBLOCK_SIZE SHA3_STATE_SIZE |
---|
| 20 | +#define SHA_MAX_BLOCK_SIZE SHA3_224_BLOCK_SIZE |
---|
19 | 21 | |
---|
20 | 22 | struct s390_sha_ctx { |
---|
21 | | - u64 count; /* message length in bytes */ |
---|
22 | | - u32 state[SHA_MAX_STATE_SIZE]; |
---|
23 | | - u8 buf[2 * SHA_MAX_BLOCK_SIZE]; |
---|
| 23 | + u64 count; /* message length in bytes */ |
---|
| 24 | + u32 state[CPACF_MAX_PARMBLOCK_SIZE / sizeof(u32)]; |
---|
| 25 | + u8 buf[SHA_MAX_BLOCK_SIZE]; |
---|
24 | 26 | int func; /* KIMD function to use */ |
---|
25 | 27 | }; |
---|
26 | 28 | |
---|