1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright 2014 Freescale Semiconductor, Inc.
4  *
5  */
6 
7 #ifndef _SHA_H
8 #define _SHA_H
9 
10 #include <fsl_sec.h>
11 #include <hash.h>
12 #include "jr.h"
13 
14 /* We support at most 32 Scatter/Gather Entries.*/
15 #define MAX_SG_32	32
16 
17 /*
18  * Hash context contains the following fields
19  * @sha_desc: Sha Descriptor
20  * @sg_num: number of entries in sg table
21  * @len: total length of buffer
22  * @sg_tbl: sg entry table
23  * @hash: index to the hash calculated
24  */
25 struct sha_ctx {
26 	uint32_t sha_desc[64];
27 	uint32_t sg_num;
28 	uint32_t len;
29 	struct sg_entry sg_tbl[MAX_SG_32];
30 	u8 hash[HASH_MAX_DIGEST_SIZE];
31 };
32 
33 #endif
34