|
WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
|
#include "mbedtls_harden_adapt.h"#include "kapi_hash.h"#include "kapi_km.h"#include "kapi_pke.h"#include "kapi_pke_cal.h"#include "kapi_symc.h"#include "kapi_trng.h"#include "hash_harden_impl.h"#include "aes_harden_impl.h"#include "ecp_harden_impl.h"
结构体 | |
| struct | mbedtls_harden_cipher_func |
宏定义 | |
| #define | MALLOC_BOUNDARY 32 |
类型定义 | |
| typedef int32_t(* | func_hash_init) (void) |
| typedef int32_t(* | func_hash_deinit) (void) |
| typedef int32_t(* | func_hash_start) (uint32_t *uapi_hash_handle, const crypto_hash_attr *hash_attr) |
| typedef int32_t(* | func_hash_update) (uint32_t uapi_hash_handle, const crypto_buf_attr *src_buf, const uint32_t len) |
| typedef int32_t(* | func_hash_get) (uint32_t uapi_hash_handle, crypto_hash_clone_ctx *hash_clone_ctx) |
| typedef int32_t(* | func_hash_set) (uint32_t uapi_hash_handle, const crypto_hash_clone_ctx *hash_clone_ctx) |
| typedef int32_t(* | func_hash_destroy) (uint32_t uapi_hash_handle) |
| typedef int32_t(* | func_hash_finish) (uint32_t uapi_hash_handle, uint8_t *out, uint32_t *out_len) |
| typedef int32_t(* | func_hkdf) (crypto_hkdf_t *hkdf_param, uint8_t *okm, uint32_t okm_length) |
| typedef int32_t(* | func_hkdf_extract) (crypto_hkdf_extract_t *extract_param, uint8_t *prk, uint32_t *prk_length) |
| typedef int32_t(* | func_hkdf_expand) (const crypto_hkdf_expand_t *expand_param, uint8_t *okm, uint32_t okm_length) |
| typedef int32_t(* | func_trng_get_random) (uint32_t *randnum) |
| typedef int32_t(* | func_trng_get_multi_random) (uint32_t size, uint8_t *randnum) |
| typedef int32_t(* | func_pbkdf2) (const crypto_kdf_pbkdf2_param *param, uint8_t *out, const uint32_t out_len) |
| typedef int32_t(* | func_symc_init) (void) |
| typedef int32_t(* | func_symc_deinit) (void) |
| typedef int32_t(* | func_symc_create) (uint32_t *symc_handle, const crypto_symc_attr *symc_attr) |
| typedef int32_t(* | func_symc_destroy) (uint32_t symc_handle) |
| typedef int32_t(* | func_symc_set_config) (uint32_t symc_handle, const crypto_symc_ctrl_t *symc_ctrl) |
| typedef int32_t(* | func_symc_get_config) (uint32_t symc_handle, crypto_symc_ctrl_t *symc_ctrl) |
| typedef int32_t(* | func_symc_attach) (uint32_t symc_handle, uint32_t keyslot_handle) |
| typedef int32_t(* | func_symc_encrypt) (uint32_t symc_handle, const crypto_buf_attr *src_buf, const crypto_buf_attr *dst_buf, uint32_t length) |
| typedef int32_t(* | func_symc_decrypt) (uint32_t symc_handle, const crypto_buf_attr *src_buf, const crypto_buf_attr *dst_buf, uint32_t length) |
| typedef int32_t(* | func_symc_get_tag) (uint32_t symc_handle, uint8_t *tag, uint32_t tag_length) |
| typedef int32_t(* | func_symc_mac_start) (uint32_t *symc_handle, const crypto_symc_mac_attr *mac_attr) |
| typedef int32_t(* | func_symc_mac_update) (uint32_t symc_handle, const crypto_buf_attr *src_buf, uint32_t length) |
| typedef int32_t(* | func_symc_mac_finish) (uint32_t symc_handle, uint8_t *mac, uint32_t *mac_length) |
| typedef int32_t(* | func_pke_init) (void) |
| typedef int32_t(* | func_pke_deinit) (void) |
| typedef int32_t(* | func_pke_mod) (const drv_pke_data *a, const drv_pke_data *p, const drv_pke_data *c) |
| typedef int32_t(* | func_pke_exp_mod) (const drv_pke_data *n, const drv_pke_data *k, const drv_pke_data *in, const drv_pke_data *out) |
| typedef int32_t(* | func_pke_ecc_gen_key) (drv_pke_ecc_curve_type curve_type, const drv_pke_data *input_priv_key, const drv_pke_data *output_priv_key, const drv_pke_ecc_point *output_pub_key) |
| typedef int32_t(* | func_pke_ecdsa_sign) (drv_pke_ecc_curve_type curve_type, const drv_pke_data *priv_key, const drv_pke_data *hash, const drv_pke_ecc_sig *sig) |
| typedef int32_t(* | func_pke_ecdsa_verify) (drv_pke_ecc_curve_type curve_type, const drv_pke_ecc_point *pub_key, const drv_pke_data *hash, const drv_pke_ecc_sig *sig) |
| typedef int32_t(* | func_pke_eddsa_sign) (drv_pke_ecc_curve_type curve_type, const drv_pke_data *priv_key, const drv_pke_msg *msg, const drv_pke_ecc_sig *sig) |
| typedef int32_t(* | func_pke_eddsa_verify) (drv_pke_ecc_curve_type curve_type, const drv_pke_ecc_point *pub_key, const drv_pke_msg *msg, const drv_pke_ecc_sig *sig) |
| typedef int32_t(* | func_pke_gen_ecdh_key) (drv_pke_ecc_curve_type curve_type, const drv_pke_ecc_point *input_pub_key, const drv_pke_data *input_priv_key, const drv_pke_data *output_shared_key) |
| typedef int32_t(* | func_pke_check_dot_on_curve) (drv_pke_ecc_curve_type curve_type, const drv_pke_ecc_point *pub_key, uint8_t *is_on_curve) |
| typedef int32_t(* | func_pke_rsa_sign) (const drv_pke_rsa_priv_key *priv_key, drv_pke_rsa_scheme scheme, drv_pke_hash_type hash_type, const drv_pke_data *input_hash, drv_pke_data *sign) |
| typedef int32_t(* | func_pke_rsa_verify) (const drv_pke_rsa_pub_key *pub_key, drv_pke_rsa_scheme scheme, drv_pke_hash_type hash_type, drv_pke_data *input_hash, const drv_pke_data *sig) |
| typedef int32_t(* | func_pke_rsa_public_encrypt) (drv_pke_rsa_scheme scheme, drv_pke_hash_type hash_type, const drv_pke_rsa_pub_key *pub_key, const drv_pke_data *input, const drv_pke_data *label, drv_pke_data *output) |
| typedef int32_t(* | func_pke_rsa_private_decrypt) (drv_pke_rsa_scheme scheme, drv_pke_hash_type hash_type, const drv_pke_rsa_priv_key *priv_key, const drv_pke_data *input, const drv_pke_data *label, drv_pke_data *output) |
| typedef int32_t(* | func_km_init) (void) |
| typedef int32_t(* | func_km_deinit) (void) |
| typedef int32_t(* | func_km_create_keyslot) (uint32_t *keyslot_handle, km_keyslot_engine key_engine) |
| typedef void(* | func_km_destroy_keyslot) (uint32_t keyslot_handle) |
| typedef int32_t(* | func_km_set_clear_key) (uint32_t keyslot_handle, uint8_t *key, uint32_t keylen, km_keyslot_engine key_engine) |
| typedef int32_t(* | func_alloc_phys_buf) (crypto_buf_attr *buf_attr, void **virt_addr, uint32_t size) |
| typedef void(* | func_free_phys_buf) (crypto_buf_attr *buf_attr, void *virt_addr, uint32_t size) |
| typedef int32_t(* | func_get_phys_mem_addr) (const void *virt_addr, uintptr_t *phys_addr) |
函数 | |
| void | mbedtls_cipher_adapt_register_func (mbedtls_harden_cipher_func *harden_cipher_func) |
| int32_t | mbedtls_adapt_register_func (void) |
| security_unified 模块对接第三方 mbedtls 接口需要注册的函数,若开启第三方对接宏 MBEDTLS_HARDEN_OPEN, 该接口由对接适配层调用。 | |
| #define MALLOC_BOUNDARY 32 |
Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2023-2023. All rights reserved. Description: define the functions, which will be registered to mbedtls.
Create: 2023-07-11
| typedef int32_t(* func_alloc_phys_buf) (crypto_buf_attr *buf_attr, void **virt_addr, uint32_t size) |
| typedef void(* func_free_phys_buf) (crypto_buf_attr *buf_attr, void *virt_addr, uint32_t size) |
| typedef int32_t(* func_get_phys_mem_addr) (const void *virt_addr, uintptr_t *phys_addr) |
| typedef int32_t(* func_hash_deinit) (void) |
| typedef int32_t(* func_hash_destroy) (uint32_t uapi_hash_handle) |
| typedef int32_t(* func_hash_finish) (uint32_t uapi_hash_handle, uint8_t *out, uint32_t *out_len) |
| typedef int32_t(* func_hash_get) (uint32_t uapi_hash_handle, crypto_hash_clone_ctx *hash_clone_ctx) |
| typedef int32_t(* func_hash_init) (void) |
| typedef int32_t(* func_hash_set) (uint32_t uapi_hash_handle, const crypto_hash_clone_ctx *hash_clone_ctx) |
| typedef int32_t(* func_hash_start) (uint32_t *uapi_hash_handle, const crypto_hash_attr *hash_attr) |
| typedef int32_t(* func_hash_update) (uint32_t uapi_hash_handle, const crypto_buf_attr *src_buf, const uint32_t len) |
| typedef int32_t(* func_hkdf) (crypto_hkdf_t *hkdf_param, uint8_t *okm, uint32_t okm_length) |
| typedef int32_t(* func_hkdf_expand) (const crypto_hkdf_expand_t *expand_param, uint8_t *okm, uint32_t okm_length) |
| typedef int32_t(* func_hkdf_extract) (crypto_hkdf_extract_t *extract_param, uint8_t *prk, uint32_t *prk_length) |
| typedef int32_t(* func_km_create_keyslot) (uint32_t *keyslot_handle, km_keyslot_engine key_engine) |
| typedef int32_t(* func_km_deinit) (void) |
| typedef void(* func_km_destroy_keyslot) (uint32_t keyslot_handle) |
| typedef int32_t(* func_km_init) (void) |
| typedef int32_t(* func_km_set_clear_key) (uint32_t keyslot_handle, uint8_t *key, uint32_t keylen, km_keyslot_engine key_engine) |
| typedef int32_t(* func_pbkdf2) (const crypto_kdf_pbkdf2_param *param, uint8_t *out, const uint32_t out_len) |
| typedef int32_t(* func_pke_check_dot_on_curve) (drv_pke_ecc_curve_type curve_type, const drv_pke_ecc_point *pub_key, uint8_t *is_on_curve) |
| typedef int32_t(* func_pke_deinit) (void) |
| typedef int32_t(* func_pke_ecc_gen_key) (drv_pke_ecc_curve_type curve_type, const drv_pke_data *input_priv_key, const drv_pke_data *output_priv_key, const drv_pke_ecc_point *output_pub_key) |
| typedef int32_t(* func_pke_ecdsa_sign) (drv_pke_ecc_curve_type curve_type, const drv_pke_data *priv_key, const drv_pke_data *hash, const drv_pke_ecc_sig *sig) |
| typedef int32_t(* func_pke_ecdsa_verify) (drv_pke_ecc_curve_type curve_type, const drv_pke_ecc_point *pub_key, const drv_pke_data *hash, const drv_pke_ecc_sig *sig) |
| typedef int32_t(* func_pke_eddsa_sign) (drv_pke_ecc_curve_type curve_type, const drv_pke_data *priv_key, const drv_pke_msg *msg, const drv_pke_ecc_sig *sig) |
| typedef int32_t(* func_pke_eddsa_verify) (drv_pke_ecc_curve_type curve_type, const drv_pke_ecc_point *pub_key, const drv_pke_msg *msg, const drv_pke_ecc_sig *sig) |
| typedef int32_t(* func_pke_exp_mod) (const drv_pke_data *n, const drv_pke_data *k, const drv_pke_data *in, const drv_pke_data *out) |
| typedef int32_t(* func_pke_gen_ecdh_key) (drv_pke_ecc_curve_type curve_type, const drv_pke_ecc_point *input_pub_key, const drv_pke_data *input_priv_key, const drv_pke_data *output_shared_key) |
| typedef int32_t(* func_pke_init) (void) |
| typedef int32_t(* func_pke_mod) (const drv_pke_data *a, const drv_pke_data *p, const drv_pke_data *c) |
| typedef int32_t(* func_pke_rsa_private_decrypt) (drv_pke_rsa_scheme scheme, drv_pke_hash_type hash_type, const drv_pke_rsa_priv_key *priv_key, const drv_pke_data *input, const drv_pke_data *label, drv_pke_data *output) |
| typedef int32_t(* func_pke_rsa_public_encrypt) (drv_pke_rsa_scheme scheme, drv_pke_hash_type hash_type, const drv_pke_rsa_pub_key *pub_key, const drv_pke_data *input, const drv_pke_data *label, drv_pke_data *output) |
| typedef int32_t(* func_pke_rsa_sign) (const drv_pke_rsa_priv_key *priv_key, drv_pke_rsa_scheme scheme, drv_pke_hash_type hash_type, const drv_pke_data *input_hash, drv_pke_data *sign) |
| typedef int32_t(* func_pke_rsa_verify) (const drv_pke_rsa_pub_key *pub_key, drv_pke_rsa_scheme scheme, drv_pke_hash_type hash_type, drv_pke_data *input_hash, const drv_pke_data *sig) |
| typedef int32_t(* func_symc_attach) (uint32_t symc_handle, uint32_t keyslot_handle) |
| typedef int32_t(* func_symc_create) (uint32_t *symc_handle, const crypto_symc_attr *symc_attr) |
| typedef int32_t(* func_symc_decrypt) (uint32_t symc_handle, const crypto_buf_attr *src_buf, const crypto_buf_attr *dst_buf, uint32_t length) |
| typedef int32_t(* func_symc_deinit) (void) |
| typedef int32_t(* func_symc_destroy) (uint32_t symc_handle) |
| typedef int32_t(* func_symc_encrypt) (uint32_t symc_handle, const crypto_buf_attr *src_buf, const crypto_buf_attr *dst_buf, uint32_t length) |
| typedef int32_t(* func_symc_get_config) (uint32_t symc_handle, crypto_symc_ctrl_t *symc_ctrl) |
| typedef int32_t(* func_symc_get_tag) (uint32_t symc_handle, uint8_t *tag, uint32_t tag_length) |
| typedef int32_t(* func_symc_init) (void) |
| typedef int32_t(* func_symc_mac_finish) (uint32_t symc_handle, uint8_t *mac, uint32_t *mac_length) |
| typedef int32_t(* func_symc_mac_start) (uint32_t *symc_handle, const crypto_symc_mac_attr *mac_attr) |
| typedef int32_t(* func_symc_mac_update) (uint32_t symc_handle, const crypto_buf_attr *src_buf, uint32_t length) |
| typedef int32_t(* func_symc_set_config) (uint32_t symc_handle, const crypto_symc_ctrl_t *symc_ctrl) |
| typedef int32_t(* func_trng_get_multi_random) (uint32_t size, uint8_t *randnum) |
| typedef int32_t(* func_trng_get_random) (uint32_t *randnum) |
| enum km_keyslot_engine |
| void mbedtls_cipher_adapt_register_func | ( | mbedtls_harden_cipher_func * | harden_cipher_func | ) |