blob: 82057c83c355b9e668c760eebb0b2845acd9de34 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
gaurav rana94e3c8c2015-02-20 12:51:46 +05302/*
3 * Copyright 2014 Freescale Semiconductor, Inc.
4 *
gaurav rana94e3c8c2015-02-20 12:51:46 +05305 */
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 */
25struct 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