xref: /aosp_15_r20/external/erofs-utils/lib/sha256.h (revision 33b1fccf6a0fada2c2875d400ed01119b7676ee5)
1 /* SPDX-License-Identifier: GPL-2.0+ OR Apache-2.0 */
2 #ifndef __EROFS_LIB_SHA256_H
3 #define __EROFS_LIB_SHA256_H
4 
5 #include "erofs/defs.h"
6 
7 struct sha256_state {
8 	u64 length;
9 	u32 state[8], curlen;
10 	u8 buf[64];
11 };
12 
13 void erofs_sha256_init(struct sha256_state *md);
14 int erofs_sha256_process(struct sha256_state *md,
15 		const unsigned char *in, unsigned long inlen);
16 int erofs_sha256_done(struct sha256_state *md, unsigned char *out);
17 
18 void erofs_sha256(const unsigned char *in, unsigned long in_size,
19 		  unsigned char out[32]);
20 
21 #endif
22