blob: 97e174ee309e8fafa144bbc02491e7f4e6bfc25f [file] [log] [blame]
#ifndef _ASR_BCM_SHA_OPTEE_H_
#define _ASR_BCM_SHA_OPTEE_H_
#include "asr-bcm-optee.h"
#ifdef CONFIG_TEE
#include <linux/tee_drv.h>
#endif
#define ASR_SHA_ACCESS_UUID \
{ \
0xc6445f2a, 0x3365, 0x11ef, \
{ 0x9e, 0x32, 0xe7, 0x0c, 0x07, 0x9f, 0x77, 0xec } \
} \
#define TEE_ALG_MD5 0x50000001
#define TEE_ALG_SHA1 0x50000002
#define TEE_ALG_SHA224 0x50000003
#define TEE_ALG_SHA256 0x50000004
#define TEE_ALG_SHA384 0x50000005
#define TEE_ALG_SHA512 0x50000006
#define HASH_CONTEXT_SIZE (256)
/*
* hash init params
*
* [in] pParams[0].value.a hash algorithm type
* [in] pParams[1].value.a hash context addr from external, such as kernel
*/
#define CMD_SHA_INIT 0x1
/*
* hash update params
* when input addr is share mem, such as params from kernel:
* [in] pParams[0].memref.buffer input data
* [in] pParams[0].memref.size length of input data
* [in] pParams[1].value.a hash context addr from external, such as kernel
*
* when input addr is physical addr, such as params from uboot:
* [in] pParams[0].value.a input data addr
* [in] pParams[0].value.b length of input data
* [in] pParams[1].value.a whether physical addr
*/
#define CMD_SHA_UPDATE 0x2
/*
* hash finish params
*
* [out] pParams[0].memref.buffer output hash
* [out] pParams[0].memref.size length of output hash
* [in] pParams[1].value.a hash context addr from external, such as kernel
*/
#define CMD_SHA_FINAL 0x3
struct asr_optee_sha_reqctx {
struct asr_sha_reqctx reqctx;
struct tee_shm *shm;
struct asrbcm_tee_context asrbcm_tee_ctx;
};
#endif