|
WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
|
#include "cipher.h"#include "kapi_symc.h"#include "kapi_hash.h"#include "sl_common.h"#include "crypto_common_macro.h"
函数 | |
| errcode_t | uapi_drv_cipher_symc_init (void) |
| 对称加密初始化。 | |
| errcode_t | uapi_drv_cipher_symc_deinit (void) |
| 对称加密去初始化。 | |
| errcode_t | uapi_drv_cipher_symc_create (uint32_t *symc_handle, const uapi_drv_cipher_symc_attr_t *symc_attr) |
| 创建symc通道,并设置symc通道属性参数。 | |
| errcode_t | uapi_drv_cipher_symc_destroy (uint32_t symc_handle) |
| 销毁symc通道。 | |
| errcode_t | uapi_drv_cipher_symc_set_config (uint32_t symc_handle, const uapi_drv_cipher_symc_ctrl_t *symc_ctrl) |
| 设置算法参数。 | |
| errcode_t | uapi_drv_cipher_symc_get_config (uint32_t symc_handle, const uapi_drv_cipher_symc_ctrl_t *symc_ctrl) |
| 获取算法参数。 | |
| errcode_t | uapi_drv_cipher_symc_attach (uint32_t symc_handle, uint32_t keyslot_handle) |
| 将key的句柄关联到加解密句柄。 | |
| errcode_t | uapi_drv_cipher_symc_detach (uint32_t symc_handle, uint32_t keyslot_handle) |
| 将key的句柄和加解密句柄解关联。 | |
| errcode_t | uapi_drv_cipher_symc_encrypt (uint32_t symc_handle, const uapi_drv_cipher_buf_attr_t *src_buf, const uapi_drv_cipher_buf_attr_t *dst_buf, uint32_t length) |
| 将源地址数据加密,输出到目的地址。 | |
| errcode_t | uapi_drv_cipher_symc_decrypt (uint32_t symc_handle, const uapi_drv_cipher_buf_attr_t *src_buf, const uapi_drv_cipher_buf_attr_t *dst_buf, uint32_t length) |
| 将源地址数据解密,输出到目的地址。 | |
| errcode_t | uapi_drv_cipher_symc_get_tag (uint32_t symc_handle, uint8_t *tag, uint32_t tag_length) |
| 获取CCM或者GCM模式的标签值。 | |
| errcode_t | uapi_drv_cipher_mac_start (uint32_t *symc_handle, const uapi_drv_cipher_symc_mac_attr_t *mac_attr) |
| 创建symc通道,并设置symc通道及算法参数。 | |
| errcode_t | uapi_drv_cipher_mac_update (uint32_t symc_handle, const uapi_drv_cipher_buf_attr_t *src_buf, uint32_t length) |
| 计算mac值 | |
| errcode_t | uapi_drv_cipher_mac_finish (uint32_t symc_handle, uint8_t *mac, uint32_t *mac_length) |
| 计算mac值 | |
| errcode_t | uapi_drv_cipher_hash_init (void) |
| Hash计算初始化。 | |
| errcode_t | uapi_drv_cipher_hash_deinit (void) |
| Hash计算去初始化。 | |
| errcode_t | uapi_drv_cipher_hash_start (uint32_t *hash_handle, const uapi_drv_cipher_hash_attr_t *hash_attr) |
| 创建hash通道,并设置hash通道及算法参数。 | |
| errcode_t | uapi_drv_cipher_hash_update (uint32_t hash_handle, const uapi_drv_cipher_buf_attr_t *src_buf, const uint32_t len) |
| hash计算 | |
| errcode_t | uapi_drv_cipher_hash_finish (uint32_t hash_handle, uint8_t *out, uint32_t *out_len) |
| HASH计算获取摘要信息,并在计算成功的时候销毁hash句柄。 | |
| errcode_t | uapi_drv_cipher_hash_get (uint32_t hash_handle, uapi_drv_cipher_hash_clone_ctx_t *hash_clone_ctx) |
| 获取HASH计算中间结果。 | |
| errcode_t | uapi_drv_cipher_hash_set (uint32_t hash_handle, const uapi_drv_cipher_hash_clone_ctx_t *hash_clone_ctx) |
| 设置HASH计算中间结果。 | |
| errcode_t | uapi_drv_cipher_hash_destroy (uint32_t hash_handle) |
| 销毁hash通道。 | |
| errcode_t | uapi_drv_cipher_pbkdf2 (const uapi_drv_cipher_kdf_pbkdf2_param_t *param, uint8_t *out, const uint32_t out_len) |
| PBKDF2算法派生秘钥。 | |
| errcode_t | uapi_drv_cipher_hkdf_extract (uapi_drv_cipher_hkdf_extract_t *extract_param, uint8_t *prk, uint32_t *prk_length) |
| 提取密钥。 | |
| errcode_t | uapi_drv_cipher_hkdf_expand (const uapi_drv_cipher_hkdf_expand_t *expand_param, uint8_t *okm, uint32_t okm_length) |
| 拓展密钥。 | |
| errcode_t | uapi_drv_cipher_hkdf (uapi_drv_cipher_hkdf_t *hkdf_param, uint8_t *okm, uint32_t okm_length) |
| HKDF,包括提取密钥和拓展密钥两步。 | |