1 /* SPDX-License-Identifier: GPL-2.0 */ << 2 /* 1 /* 3 * Common values for SHA-3 algorithms 2 * Common values for SHA-3 algorithms 4 */ 3 */ 5 #ifndef __CRYPTO_SHA3_H__ 4 #ifndef __CRYPTO_SHA3_H__ 6 #define __CRYPTO_SHA3_H__ 5 #define __CRYPTO_SHA3_H__ 7 6 8 #define SHA3_224_DIGEST_SIZE (224 / 8) 7 #define SHA3_224_DIGEST_SIZE (224 / 8) 9 #define SHA3_224_BLOCK_SIZE (200 - 2 * SHA 8 #define SHA3_224_BLOCK_SIZE (200 - 2 * SHA3_224_DIGEST_SIZE) 10 9 11 #define SHA3_256_DIGEST_SIZE (256 / 8) 10 #define SHA3_256_DIGEST_SIZE (256 / 8) 12 #define SHA3_256_BLOCK_SIZE (200 - 2 * SHA 11 #define SHA3_256_BLOCK_SIZE (200 - 2 * SHA3_256_DIGEST_SIZE) 13 12 14 #define SHA3_384_DIGEST_SIZE (384 / 8) 13 #define SHA3_384_DIGEST_SIZE (384 / 8) 15 #define SHA3_384_BLOCK_SIZE (200 - 2 * SHA 14 #define SHA3_384_BLOCK_SIZE (200 - 2 * SHA3_384_DIGEST_SIZE) 16 15 17 #define SHA3_512_DIGEST_SIZE (512 / 8) 16 #define SHA3_512_DIGEST_SIZE (512 / 8) 18 #define SHA3_512_BLOCK_SIZE (200 - 2 * SHA 17 #define SHA3_512_BLOCK_SIZE (200 - 2 * SHA3_512_DIGEST_SIZE) 19 18 20 struct sha3_state { 19 struct sha3_state { 21 u64 st[25]; 20 u64 st[25]; >> 21 unsigned int md_len; 22 unsigned int rsiz; 22 unsigned int rsiz; 23 unsigned int rsizw; 23 unsigned int rsizw; 24 24 25 unsigned int partial; 25 unsigned int partial; 26 u8 buf[SHA3_224_BLOCK_SIZ 26 u8 buf[SHA3_224_BLOCK_SIZE]; 27 }; 27 }; 28 << 29 int crypto_sha3_init(struct shash_desc *desc); << 30 int crypto_sha3_update(struct shash_desc *desc << 31 unsigned int len); << 32 int crypto_sha3_final(struct shash_desc *desc, << 33 28 34 #endif 29 #endif 35 30
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.