1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Common values for SHA-3 algorithms
4  */
5 #ifndef __CRYPTO_SHA3_H__
6 #define __CRYPTO_SHA3_H__
7 
8 #include <linux/types.h>
9 
10 #define SHA3_224_DIGEST_SIZE	(224 / 8)
11 #define SHA3_224_BLOCK_SIZE	(200 - 2 * SHA3_224_DIGEST_SIZE)
12 #define SHA3_224_EXPORT_SIZE	SHA3_STATE_SIZE + SHA3_224_BLOCK_SIZE + 1
13 
14 #define SHA3_256_DIGEST_SIZE	(256 / 8)
15 #define SHA3_256_BLOCK_SIZE	(200 - 2 * SHA3_256_DIGEST_SIZE)
16 #define SHA3_256_EXPORT_SIZE	SHA3_STATE_SIZE + SHA3_256_BLOCK_SIZE + 1
17 
18 #define SHA3_384_DIGEST_SIZE	(384 / 8)
19 #define SHA3_384_BLOCK_SIZE	(200 - 2 * SHA3_384_DIGEST_SIZE)
20 #define SHA3_384_EXPORT_SIZE	SHA3_STATE_SIZE + SHA3_384_BLOCK_SIZE + 1
21 
22 #define SHA3_512_DIGEST_SIZE	(512 / 8)
23 #define SHA3_512_BLOCK_SIZE	(200 - 2 * SHA3_512_DIGEST_SIZE)
24 #define SHA3_512_EXPORT_SIZE	SHA3_STATE_SIZE + SHA3_512_BLOCK_SIZE + 1
25 
26 #define SHA3_STATE_SIZE		200
27 
28 struct shash_desc;
29 
30 struct sha3_state {
31 	u64		st[SHA3_STATE_SIZE / 8];
32 };
33 
34 int crypto_sha3_init(struct shash_desc *desc);
35 
36 #endif
37