WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
hal_hash.c 文件参考
#include "hal_hash.h"
#include "crypto_drv_common.h"
#include "hal_spacc_reg.h"
hal_hash.c 的引用(Include)关系图:

结构体

struct  hash_entry_in
 
struct  hal_hash_hard_chn_ctx
 

宏定义

#define crypto_memory_barrier()
 
#define CACHE_LINE_SIZE   32
 
#define HASH_COMPAT_ERRNO(err_code)   HAL_COMPAT_ERRNO(ERROR_MODULE_HASH, err_code)
 
#define HASH_MAX_DEPTH   2
 
#define HASH_NODE_SIZE   (sizeof(hash_entry_in) * HASH_MAX_DEPTH)
 
#define HASH_SS_SECURE_VAL   0x5
 
#define HASH_SS_NONSECURE_VAL   0xa
 
#define crypto_hash_wait(idx)
 

枚举

enum  hash_chn_alg_sel_e { HASH_CHN_ALG_SEL_SHA1 = 0xa , HASH_CHN_ALG_SEL_SHA2 = 0xb , HASH_CHN_ALG_SEL_SM3 = 0xc }
 
enum  hash_chn_alg_mode_e { HASH_CHN_ALG_MODE_224 = 0x0 , HASH_CHN_ALG_MODE_256 = 0x1 , HASH_CHN_ALG_MODE_384 = 0x2 , HASH_CHN_ALG_MODE_512 = 0x3 }
 

函数

td_s32 hal_cipher_hash_init (td_void)
 
td_s32 hal_cipher_hash_deinit (td_void)
 
td_s32 hal_hash_lock (td_u32 chn_num)
 
td_s32 hal_hash_unlock (td_u32 chn_num)
 
td_s32 hal_cipher_hash_config (td_u32 chn_num, crypto_hash_type hash_type, const td_u32 *state)
 
td_s32 hal_cipher_hash_attach (td_u32 chn_num, td_u32 keyslot_chn_num)
 
td_s32 hal_cipher_hash_add_in_node (td_u32 chn_num, td_phys_addr_t data_phys, td_u32 data_len, in_node_type_e in_node_type)
 
td_s32 hal_cipher_hash_start (td_u32 chn_num, td_bool is_wait)
 
td_s32 hal_cipher_hash_wait_done (td_u32 chn_num, td_u32 *state, td_u32 state_size)
 
td_s32 hal_cipher_hash_register_wait_func (td_u32 chn_num, td_void *wait, crypto_wait_timeout_interruptible wait_func, td_u32 timeout_ms)
 
td_s32 hal_cipher_hash_done_notify (td_u32 chn_num)
 
td_u32 hal_cipher_hash_done_try (td_u32 chn_num)
 
td_void hal_hash_debug (td_void)
 
td_void hal_hash_debug_chn (td_u32 chn_num)
 
td_s32 hal_cipher_hash_wait_func_config (td_u32 chn_num, td_bool is_enable)
 

宏定义说明

◆ CACHE_LINE_SIZE

#define CACHE_LINE_SIZE   32

◆ crypto_hash_wait

#define crypto_hash_wait (   idx)
值:
do { \
if ((idx) <= MS_TO_US) { \
crypto_udelay(1); /* short waitting for 1000 us */ \
} else { \
crypto_msleep(1); /* long waitting for 5000 ms */ \
} \
} while (0)
#define MS_TO_US
Definition crypto_common_def.h:12

◆ crypto_memory_barrier

#define crypto_memory_barrier ( )

Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2023-2023. All rights reserved.

Description: hal hash.
History:
2023-03-22, Create file.

◆ HASH_COMPAT_ERRNO

#define HASH_COMPAT_ERRNO (   err_code)    HAL_COMPAT_ERRNO(ERROR_MODULE_HASH, err_code)

◆ HASH_MAX_DEPTH

#define HASH_MAX_DEPTH   2

◆ HASH_NODE_SIZE

#define HASH_NODE_SIZE   (sizeof(hash_entry_in) * HASH_MAX_DEPTH)

◆ HASH_SS_NONSECURE_VAL

#define HASH_SS_NONSECURE_VAL   0xa

◆ HASH_SS_SECURE_VAL

#define HASH_SS_SECURE_VAL   0x5

枚举类型说明

◆ hash_chn_alg_mode_e

枚举值
HASH_CHN_ALG_MODE_224 
HASH_CHN_ALG_MODE_256 
HASH_CHN_ALG_MODE_384 
HASH_CHN_ALG_MODE_512 

◆ hash_chn_alg_sel_e

枚举值
HASH_CHN_ALG_SEL_SHA1 
HASH_CHN_ALG_SEL_SHA2 
HASH_CHN_ALG_SEL_SM3 

函数说明

◆ hal_cipher_hash_add_in_node()

td_s32 hal_cipher_hash_add_in_node ( td_u32  chn_num,
td_phys_addr_t  data_phys,
td_u32  data_len,
in_node_type_e  in_node_type 
)

◆ hal_cipher_hash_attach()

td_s32 hal_cipher_hash_attach ( td_u32  chn_num,
td_u32  keyslot_chn_num 
)

◆ hal_cipher_hash_config()

td_s32 hal_cipher_hash_config ( td_u32  chn_num,
crypto_hash_type  hash_type,
const td_u32 state 
)

◆ hal_cipher_hash_deinit()

td_s32 hal_cipher_hash_deinit ( td_void  )

◆ hal_cipher_hash_done_notify()

td_s32 hal_cipher_hash_done_notify ( td_u32  chn_num)

◆ hal_cipher_hash_done_try()

td_u32 hal_cipher_hash_done_try ( td_u32  chn_num)

◆ hal_cipher_hash_init()

td_s32 hal_cipher_hash_init ( td_void  )

Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2023-2023. All rights reserved.

Description: hal hash header.
History:
2023-03-22, Create file.

◆ hal_cipher_hash_register_wait_func()

td_s32 hal_cipher_hash_register_wait_func ( td_u32  chn_num,
td_void wait,
crypto_wait_timeout_interruptible  wait_func,
td_u32  timeout_ms 
)

◆ hal_cipher_hash_start()

td_s32 hal_cipher_hash_start ( td_u32  chn_num,
td_bool  is_wait 
)

◆ hal_cipher_hash_wait_done()

td_s32 hal_cipher_hash_wait_done ( td_u32  chn_num,
td_u32 state,
td_u32  state_size 
)

◆ hal_cipher_hash_wait_func_config()

td_s32 hal_cipher_hash_wait_func_config ( td_u32  chn_num,
td_bool  is_enable 
)

◆ hal_hash_debug()

td_void hal_hash_debug ( td_void  )

◆ hal_hash_debug_chn()

td_void hal_hash_debug_chn ( td_u32  chn_num)

◆ hal_hash_lock()

td_s32 hal_hash_lock ( td_u32  chn_num)

◆ hal_hash_unlock()

td_s32 hal_hash_unlock ( td_u32  chn_num)