Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Common values for SHA-3 algorithms
0004  */
0005 #ifndef __CRYPTO_SHA3_H__
0006 #define __CRYPTO_SHA3_H__
0007 
0008 #define SHA3_224_DIGEST_SIZE    (224 / 8)
0009 #define SHA3_224_BLOCK_SIZE (200 - 2 * SHA3_224_DIGEST_SIZE)
0010 
0011 #define SHA3_256_DIGEST_SIZE    (256 / 8)
0012 #define SHA3_256_BLOCK_SIZE (200 - 2 * SHA3_256_DIGEST_SIZE)
0013 
0014 #define SHA3_384_DIGEST_SIZE    (384 / 8)
0015 #define SHA3_384_BLOCK_SIZE (200 - 2 * SHA3_384_DIGEST_SIZE)
0016 
0017 #define SHA3_512_DIGEST_SIZE    (512 / 8)
0018 #define SHA3_512_BLOCK_SIZE (200 - 2 * SHA3_512_DIGEST_SIZE)
0019 
0020 struct sha3_state {
0021     u64     st[25];
0022     unsigned int    rsiz;
0023     unsigned int    rsizw;
0024 
0025     unsigned int    partial;
0026     u8      buf[SHA3_224_BLOCK_SIZE];
0027 };
0028 
0029 int crypto_sha3_init(struct shash_desc *desc);
0030 int crypto_sha3_update(struct shash_desc *desc, const u8 *data,
0031                unsigned int len);
0032 int crypto_sha3_final(struct shash_desc *desc, u8 *out);
0033 
0034 #endif