74 lines
2.7 KiB
C
74 lines
2.7 KiB
C
/*
|
|
Copyright (c), 2001-2022, Shenshu Tech. Co., Ltd.
|
|
*/
|
|
|
|
#ifndef __SS_MPI_CIPHER_H__
|
|
#define __SS_MPI_CIPHER_H__
|
|
|
|
#include "ot_common_cipher.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
td_s32 ss_mpi_cipher_init(td_void);
|
|
|
|
td_s32 ss_mpi_cipher_deinit(td_void);
|
|
|
|
td_s32 ss_mpi_cipher_create_handle(td_handle *handle, const ot_cipher_attr *cipher_attr);
|
|
|
|
td_s32 ss_mpi_cipher_destroy_handle(td_handle handle);
|
|
|
|
td_s32 ss_mpi_cipher_cfg_handle(td_handle handle, const ot_cipher_ctrl *ctrl);
|
|
|
|
td_s32 ss_mpi_cipher_get_handle_cfg(td_handle handle, ot_cipher_ctrl *ctrl);
|
|
|
|
td_s32 ss_mpi_cipher_cfg_handle_ex(td_handle handle, const ot_cipher_ctrl_ex *ctrl_ex);
|
|
|
|
td_s32 ss_mpi_cipher_encrypt(td_handle handle,
|
|
td_phys_addr_t src_phys_addr, td_phys_addr_t dst_phys_addr, td_u32 byte_len);
|
|
|
|
td_s32 ss_mpi_cipher_decrypt(td_handle handle,
|
|
td_phys_addr_t src_phys_addr, td_phys_addr_t dst_phys_addr, td_u32 byte_len);
|
|
|
|
td_s32 ss_mpi_cipher_encrypt_virt(td_handle handle, const td_u8 *src_data, td_u8 *dst_data, td_u32 byte_len);
|
|
|
|
td_s32 ss_mpi_cipher_decrypt_virt(td_handle handle, const td_u8 *src_data, td_u8 *dst_data, td_u32 byte_len);
|
|
|
|
td_s32 ss_mpi_cipher_encrypt_multi_pack(td_handle handle, const ot_cipher_data *data_pack, td_u32 data_pack_num);
|
|
|
|
td_s32 ss_mpi_cipher_decrypt_multi_pack(td_handle handle, const ot_cipher_data *data_pack, td_u32 data_pack_num);
|
|
|
|
td_s32 ss_mpi_cipher_get_tag(td_handle handle, td_u8 *tag, td_u32 tag_buf_len, td_u32 *tag_len);
|
|
|
|
td_s32 ss_mpi_cipher_klad_encrypt_key(ot_cipher_ca_type root_key,
|
|
ot_cipher_klad_target target, const td_u8 *clean_key, td_u8 *encrypt_key, td_u32 key_len);
|
|
|
|
td_s32 ss_mpi_cipher_hash_init(const ot_cipher_hash_attr *hash_attr, td_handle *handle);
|
|
|
|
td_s32 ss_mpi_cipher_hash_update(td_handle handle, const td_u8 *in_data, td_u32 in_data_len);
|
|
|
|
td_s32 ss_mpi_cipher_hash_final(td_handle handle, td_u8 *out_hash, td_u32 out_hash_buf_len, td_u32 *out_hash_len);
|
|
|
|
td_s32 ss_mpi_cipher_get_random_num(td_u32 *random_num);
|
|
|
|
td_s32 ss_mpi_cipher_rsa_pub_encrypt(const ot_cipher_rsa_pub_encrypt *rsa_encrypt, ot_cipher_rsa_crypt *rsa_data);
|
|
|
|
td_s32 ss_mpi_cipher_rsa_private_decrypt(const ot_cipher_rsa_private_encrypt *rsa_decrypt,
|
|
ot_cipher_rsa_crypt *rsa_data);
|
|
|
|
td_s32 ss_mpi_cipher_rsa_sign(const ot_cipher_rsa_sign *rsa_sign, ot_cipher_sign_data *sign_data);
|
|
|
|
td_s32 ss_mpi_cipher_rsa_verify(const ot_cipher_rsa_verify *rsa_verify, const ot_cipher_verify_data *verify_data);
|
|
|
|
td_s32 ss_mpi_cipher_rsa_private_encrypt(const ot_cipher_rsa_private_encrypt *rsa_encrypt,
|
|
ot_cipher_rsa_crypt *rsa_data);
|
|
|
|
td_s32 ss_mpi_cipher_rsa_pub_decrypt(const ot_cipher_rsa_pub_encrypt *rsa_decrypt, ot_cipher_rsa_crypt *rsa_data);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __SS_MPI_CIPHER_H__ */
|