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

宏定义

#define HKL_COM_LOCK_STAT_REE_LOCK   0xaa
 
#define HKL_ENGINE_AES   0x20
 
#define HKL_ENGINE_SM4   0x50
 
#define HKL_ENGINE_SHA1_HMAC   0xa0
 
#define HKL_ENGINE_SHA2_HMAC   0xa1
 
#define HKL_ENGINE_SM3_HMAC   0xa2
 
#define HKL_PORT_SEL_MCIPHER   0x1
 
#define HKL_PORT_SEL_HMAC   0x1 /* the sample as MCIPHER. */
 
#define HKL_PORT_SEL_FLASH   0x7
 
#define HKL_FLASH_SEL_REE_DEC   0
 
#define HKL_KEY_LEN   16
 
#define HKL_CLR_KEY_SIZE_128   0x1
 
#define HKL_CLR_KEY_SIZE_192   0x2
 
#define HKL_CLR_KEY_SIZE_256   0x3
 
#define HMAC_KEY_BLOCK_SIZE_512   64
 
#define HMAC_KEY_BLOCK_SIZE_1024   128
 
#define HMAC_KEY_CAL_CNT_512   4
 
#define HMAC_KEY_CAL_CNT_1024   8
 
#define HKL_HMAC_KEY_MAX_SIZE   128
 
#define HKL_COM_KEY_SIZE_128   0x1
 
#define HKL_COM_KEY_SIZE_192   0x2
 
#define HKL_COM_KEY_SIZE_256   0x3
 
#define HKL_COM_RK_CHOOSE_ODRK1   0x7
 
#define HKL_COM_RK_CHOOSE_ABRK_REE   0x15
 
#define HKL_COM_RK_CHOOSE_RDRK_REE   0x17
 

函数

td_s32 hal_klad_lock (td_void)
 
td_s32 hal_klad_unlock (td_void)
 
td_s32 hal_klad_set_key_crypto_cfg (td_bool encrypt_support, td_bool decrypt_support, crypto_klad_engine engine)
 
td_s32 hal_klad_set_key_dest_cfg (crypto_klad_dest dest, crypto_klad_flash_key_type flash_key_type)
 
td_s32 hal_klad_set_key_secure_cfg (const crypto_klad_key_secure_config *secure_cfg)
 
td_s32 hal_klad_set_key_addr (crypto_klad_dest klad_dest, td_u32 keyslot_chn)
 
td_s32 hal_klad_set_data (const td_u8 *data, td_u32 data_length)
 
td_s32 hal_klad_start_clr_route (crypto_klad_dest klad_dest, const crypto_klad_clear_key *clear_key)
 
td_s32 hal_klad_start_com_route (crypto_kdf_hard_key_type rk_type, const crypto_klad_effective_key *content_key, crypto_klad_dest klad_dest)
 

宏定义说明

◆ HKL_CLR_KEY_SIZE_128

#define HKL_CLR_KEY_SIZE_128   0x1

◆ HKL_CLR_KEY_SIZE_192

#define HKL_CLR_KEY_SIZE_192   0x2

◆ HKL_CLR_KEY_SIZE_256

#define HKL_CLR_KEY_SIZE_256   0x3

◆ HKL_COM_KEY_SIZE_128

#define HKL_COM_KEY_SIZE_128   0x1

◆ HKL_COM_KEY_SIZE_192

#define HKL_COM_KEY_SIZE_192   0x2

◆ HKL_COM_KEY_SIZE_256

#define HKL_COM_KEY_SIZE_256   0x3

◆ HKL_COM_LOCK_STAT_REE_LOCK

#define HKL_COM_LOCK_STAT_REE_LOCK   0xaa

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

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

◆ HKL_COM_RK_CHOOSE_ABRK_REE

#define HKL_COM_RK_CHOOSE_ABRK_REE   0x15

◆ HKL_COM_RK_CHOOSE_ODRK1

#define HKL_COM_RK_CHOOSE_ODRK1   0x7

◆ HKL_COM_RK_CHOOSE_RDRK_REE

#define HKL_COM_RK_CHOOSE_RDRK_REE   0x17

◆ HKL_ENGINE_AES

#define HKL_ENGINE_AES   0x20

◆ HKL_ENGINE_SHA1_HMAC

#define HKL_ENGINE_SHA1_HMAC   0xa0

◆ HKL_ENGINE_SHA2_HMAC

#define HKL_ENGINE_SHA2_HMAC   0xa1

◆ HKL_ENGINE_SM3_HMAC

#define HKL_ENGINE_SM3_HMAC   0xa2

◆ HKL_ENGINE_SM4

#define HKL_ENGINE_SM4   0x50

◆ HKL_FLASH_SEL_REE_DEC

#define HKL_FLASH_SEL_REE_DEC   0

◆ HKL_HMAC_KEY_MAX_SIZE

#define HKL_HMAC_KEY_MAX_SIZE   128

◆ HKL_KEY_LEN

#define HKL_KEY_LEN   16

◆ HKL_PORT_SEL_FLASH

#define HKL_PORT_SEL_FLASH   0x7

◆ HKL_PORT_SEL_HMAC

#define HKL_PORT_SEL_HMAC   0x1 /* the sample as MCIPHER. */

◆ HKL_PORT_SEL_MCIPHER

#define HKL_PORT_SEL_MCIPHER   0x1

◆ HMAC_KEY_BLOCK_SIZE_1024

#define HMAC_KEY_BLOCK_SIZE_1024   128

◆ HMAC_KEY_BLOCK_SIZE_512

#define HMAC_KEY_BLOCK_SIZE_512   64

◆ HMAC_KEY_CAL_CNT_1024

#define HMAC_KEY_CAL_CNT_1024   8

◆ HMAC_KEY_CAL_CNT_512

#define HMAC_KEY_CAL_CNT_512   4

函数说明

◆ hal_klad_lock()

td_s32 hal_klad_lock ( td_void  )

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

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

◆ hal_klad_set_data()

td_s32 hal_klad_set_data ( const td_u8 data,
td_u32  data_length 
)

◆ hal_klad_set_key_addr()

td_s32 hal_klad_set_key_addr ( crypto_klad_dest  klad_dest,
td_u32  keyslot_chn 
)

◆ hal_klad_set_key_crypto_cfg()

td_s32 hal_klad_set_key_crypto_cfg ( td_bool  encrypt_support,
td_bool  decrypt_support,
crypto_klad_engine  engine 
)

◆ hal_klad_set_key_dest_cfg()

td_s32 hal_klad_set_key_dest_cfg ( crypto_klad_dest  dest,
crypto_klad_flash_key_type  flash_key_type 
)

◆ hal_klad_set_key_secure_cfg()

td_s32 hal_klad_set_key_secure_cfg ( const crypto_klad_key_secure_config secure_cfg)

◆ hal_klad_start_clr_route()

td_s32 hal_klad_start_clr_route ( crypto_klad_dest  klad_dest,
const crypto_klad_clear_key clear_key 
)

◆ hal_klad_start_com_route()

td_s32 hal_klad_start_com_route ( crypto_kdf_hard_key_type  rk_type,
const crypto_klad_effective_key content_key,
crypto_klad_dest  klad_dest 
)

◆ hal_klad_unlock()

td_s32 hal_klad_unlock ( td_void  )