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

宏定义

#define CRYPTO_SYMC_TIMEOUT   (6000)
 
#define SYMC_COMPAT_ERRNO(err_code)   DRV_COMPAT_ERRNO(ERROR_MODULE_SYMC, err_code)
 
#define symc_null_ptr_chk(ptr)    crypto_chk_return((ptr) == TD_NULL, SYMC_COMPAT_ERRNO(ERROR_PARAM_IS_NULL), #ptr" is NULL\n")
 
#define CRYPTO_DRV_CCM_DMA_SIZE   (CRYPTO_AES_BLOCK_SIZE_IN_BYTES * 3) /* For n + ccm_header + ccm_padding. */
 
#define CRYPTO_DRV_GCM_DMA_SIZE   (CRYPTO_AES_BLOCK_SIZE_IN_BYTES * 2) /* For aad_padding + clen. */
 
#define CRYPTO_DRV_DMA_TOTAL_SIZE   (CRYPTO_DRV_DMA_SIZE * CRYPTO_SYMC_HARD_CHANNEL_MAX)
 

函数

td_s32 inner_symc_drv_handle_chk (td_handle symc_handle)
 
drv_symc_context_tinner_get_symc_ctx (td_handle symc_handle)
 
td_s32 drv_cipher_symc_init (td_void)
 
td_s32 drv_cipher_symc_deinit (td_void)
 
td_s32 drv_cipher_symc_create (td_handle *symc_handle, const crypto_symc_attr *symc_attr)
 
td_s32 drv_cipher_symc_destroy (td_handle symc_handle)
 
td_s32 inner_symc_cfg_param_check (const crypto_symc_ctrl_t *symc_ctrl)
 
td_s32 drv_cipher_symc_set_config (td_handle symc_handle, const crypto_symc_ctrl_t *symc_ctrl)
 
td_s32 drv_cipher_symc_get_config (td_handle symc_handle, crypto_symc_ctrl_t *symc_ctrl)
 
td_s32 drv_cipher_symc_attach (td_handle symc_handle, td_handle keyslot_handle)
 
td_s32 drv_cipher_symc_encrypt (td_handle symc_handle, const crypto_buf_attr *src_buf, const crypto_buf_attr *dst_buf, td_u32 length)
 
td_s32 drv_cipher_symc_decrypt (td_handle symc_handle, const crypto_buf_attr *src_buf, const crypto_buf_attr *dst_buf, td_u32 length)
 
td_s32 drv_cipher_symc_get_tag (td_handle symc_handle, td_u8 *tag, td_u32 tag_length)
 
td_s32 drv_cipher_dma_copy (const crypto_buf_attr *src_buf, const crypto_buf_attr *dst_buf, td_u32 length)
 
td_s32 inner_drv_get_mac_ctx (td_handle symc_handle, crypto_symc_mac_ctx *mac_ctx)
 
td_s32 inner_drv_set_mac_ctx (td_handle symc_handle, const crypto_symc_mac_ctx *mac_ctx)
 
td_s32 drv_cipher_symc_set_key (td_handle symc_handle, td_u8 *key, td_u32 key_len)
 
td_void drv_cipher_debug_handle (td_handle symc_handle)
 
td_s32 inner_drv_symc_crypto_chk (td_handle symc_handle, const crypto_buf_attr *src_buf, const crypto_buf_attr *dst_buf, td_u32 length)
 

宏定义说明

◆ CRYPTO_DRV_CCM_DMA_SIZE

#define CRYPTO_DRV_CCM_DMA_SIZE   (CRYPTO_AES_BLOCK_SIZE_IN_BYTES * 3) /* For n + ccm_header + ccm_padding. */

◆ CRYPTO_DRV_DMA_TOTAL_SIZE

#define CRYPTO_DRV_DMA_TOTAL_SIZE   (CRYPTO_DRV_DMA_SIZE * CRYPTO_SYMC_HARD_CHANNEL_MAX)

◆ CRYPTO_DRV_GCM_DMA_SIZE

#define CRYPTO_DRV_GCM_DMA_SIZE   (CRYPTO_AES_BLOCK_SIZE_IN_BYTES * 2) /* For aad_padding + clen. */

◆ CRYPTO_SYMC_TIMEOUT

#define CRYPTO_SYMC_TIMEOUT   (6000)

Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2023-2023. All rights reserved. Description: symmetric algorithm implementation.

Create: 2023-05-26

◆ SYMC_COMPAT_ERRNO

#define SYMC_COMPAT_ERRNO (   err_code)    DRV_COMPAT_ERRNO(ERROR_MODULE_SYMC, err_code)

◆ symc_null_ptr_chk

#define symc_null_ptr_chk (   ptr)     crypto_chk_return((ptr) == TD_NULL, SYMC_COMPAT_ERRNO(ERROR_PARAM_IS_NULL), #ptr" is NULL\n")

函数说明

◆ drv_cipher_debug_handle()

td_void drv_cipher_debug_handle ( td_handle  symc_handle)

◆ drv_cipher_dma_copy()

td_s32 drv_cipher_dma_copy ( const crypto_buf_attr src_buf,
const crypto_buf_attr dst_buf,
td_u32  length 
)

◆ drv_cipher_symc_attach()

td_s32 drv_cipher_symc_attach ( td_handle  symc_handle,
td_handle  keyslot_handle 
)

◆ drv_cipher_symc_create()

td_s32 drv_cipher_symc_create ( td_handle symc_handle,
const crypto_symc_attr symc_attr 
)

◆ drv_cipher_symc_decrypt()

td_s32 drv_cipher_symc_decrypt ( td_handle  symc_handle,
const crypto_buf_attr src_buf,
const crypto_buf_attr dst_buf,
td_u32  length 
)

◆ drv_cipher_symc_deinit()

td_s32 drv_cipher_symc_deinit ( td_void  )

◆ drv_cipher_symc_destroy()

td_s32 drv_cipher_symc_destroy ( td_handle  symc_handle)

◆ drv_cipher_symc_encrypt()

td_s32 drv_cipher_symc_encrypt ( td_handle  symc_handle,
const crypto_buf_attr src_buf,
const crypto_buf_attr dst_buf,
td_u32  length 
)

◆ drv_cipher_symc_get_config()

td_s32 drv_cipher_symc_get_config ( td_handle  symc_handle,
crypto_symc_ctrl_t symc_ctrl 
)

◆ drv_cipher_symc_get_tag()

td_s32 drv_cipher_symc_get_tag ( td_handle  symc_handle,
td_u8 tag,
td_u32  tag_length 
)

◆ drv_cipher_symc_init()

td_s32 drv_cipher_symc_init ( td_void  )

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

Description: cipher driver symc header.
History:
2023-03-22, Create file.

◆ drv_cipher_symc_set_config()

td_s32 drv_cipher_symc_set_config ( td_handle  symc_handle,
const crypto_symc_ctrl_t symc_ctrl 
)

◆ drv_cipher_symc_set_key()

td_s32 drv_cipher_symc_set_key ( td_handle  symc_handle,
td_u8 key,
td_u32  key_len 
)

◆ inner_drv_get_mac_ctx()

td_s32 inner_drv_get_mac_ctx ( td_handle  symc_handle,
crypto_symc_mac_ctx mac_ctx 
)

◆ inner_drv_set_mac_ctx()

td_s32 inner_drv_set_mac_ctx ( td_handle  symc_handle,
const crypto_symc_mac_ctx mac_ctx 
)

◆ inner_drv_symc_crypto_chk()

td_s32 inner_drv_symc_crypto_chk ( td_handle  symc_handle,
const crypto_buf_attr src_buf,
const crypto_buf_attr dst_buf,
td_u32  length 
)

◆ inner_get_symc_ctx()

drv_symc_context_t * inner_get_symc_ctx ( td_handle  symc_handle)

◆ inner_symc_cfg_param_check()

td_s32 inner_symc_cfg_param_check ( const crypto_symc_ctrl_t symc_ctrl)

◆ inner_symc_drv_handle_chk()

td_s32 inner_symc_drv_handle_chk ( td_handle  symc_handle)