|
WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
|
#include "hal_klad.h"#include "hal_klad_reg.h"#include "crypto_drv_common.h"#include "crypto_common_macro.h"
宏定义 | |
| #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) |
| #define HKL_CLR_KEY_SIZE_128 0x1 |
| #define HKL_CLR_KEY_SIZE_192 0x2 |
| #define HKL_CLR_KEY_SIZE_256 0x3 |
| #define HKL_COM_KEY_SIZE_128 0x1 |
| #define HKL_COM_KEY_SIZE_192 0x2 |
| #define HKL_COM_KEY_SIZE_256 0x3 |
| #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.
| #define HKL_COM_RK_CHOOSE_ABRK_REE 0x15 |
| #define HKL_COM_RK_CHOOSE_ODRK1 0x7 |
| #define HKL_COM_RK_CHOOSE_RDRK_REE 0x17 |
| #define HKL_ENGINE_AES 0x20 |
| #define HKL_ENGINE_SHA1_HMAC 0xa0 |
| #define HKL_ENGINE_SHA2_HMAC 0xa1 |
| #define HKL_ENGINE_SM3_HMAC 0xa2 |
| #define HKL_ENGINE_SM4 0x50 |
| #define HKL_FLASH_SEL_REE_DEC 0 |
| #define HKL_HMAC_KEY_MAX_SIZE 128 |
| #define HKL_KEY_LEN 16 |
| #define HKL_PORT_SEL_FLASH 0x7 |
| #define HKL_PORT_SEL_HMAC 0x1 /* the sample as MCIPHER. */ |
| #define HKL_PORT_SEL_MCIPHER 0x1 |
| #define HMAC_KEY_BLOCK_SIZE_1024 128 |
| #define HMAC_KEY_BLOCK_SIZE_512 64 |
| #define HMAC_KEY_CAL_CNT_1024 8 |
| #define HMAC_KEY_CAL_CNT_512 4 |
Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2023-2023. All rights reserved.
Description: hal klad header.
History:
2023-03-22, Create file.
| td_s32 hal_klad_set_key_addr | ( | crypto_klad_dest | klad_dest, |
| td_u32 | keyslot_chn | ||
| ) |
| 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_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 | ||
| ) |