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

函数

td_s32 ecc_ecfp_jac_to_aff (const drv_pke_data *mod_p)
 Get final calculate result. trans (ecc_addr_cx, ecc_addr_cy, ecc_addr_cz) from jac to aff. aff_x = jac_x * ((jac_z)^-2); aff_y = jac_y * ((jac_z)^-3)
 
td_s32 ecc_ecfp_montgomery_data_aff (const drv_pke_ecc_point *in, const drv_pke_data *mod_p, const drv_pke_ecc_point *out CIPHER_CHECK_WORD)
 montgomery the point coordinate in affine coordinate system. Before call this API, you should have set curve initial parameters into the DRAM.
 
td_s32 ecc_ecfp_demontgomery_data_aff (const drv_pke_ecc_point *r, td_u32 work_len)
 demontgomery data, (ecc_addr_cx, ecc_addr_cy) -> (ecc_addr_cx, ecc_addr_cy). Before calculate demont, you should have set const_1 to ecc_addr_const_1.
 
td_s32 update_modulus (const td_u8 *n, const td_u32 n_len CIPHER_CHECK_WORD)
 update modulus into ecc_addr_m, and set new montgomery parameter into reg. Before call this API, you should have set initial parameters into PKE DRAM.
 
td_s32 ecc_ecfn_inv (const drv_pke_data *a, const drv_pke_data *n, const drv_pke_data *c CIPHER_CHECK_WORD)
 c = ~a mod n, ecc_addr_s = 1/ecc_addr_k. Before call this API, you should have set curve initial parameters into DRAM, which must include ecc_addr_rrn, ecc_addr_mont_1_n.
 

函数说明

◆ ecc_ecfn_inv()

td_s32 ecc_ecfn_inv ( const drv_pke_data a,
const drv_pke_data n,
const drv_pke_data *c  CIPHER_CHECK_WORD 
)

c = ~a mod n, ecc_addr_s = 1/ecc_addr_k. Before call this API, you should have set curve initial parameters into DRAM, which must include ecc_addr_rrn, ecc_addr_mont_1_n.

参数
athe input data.
nthe modulus.
cthe output data.
CIPHER_CHECK_WORDifdef SEC_ENHANCE, the value is XOR result of parameters, otherwise it doesn't exist.
返回
td_s32 TD_SUCCESS or others.

◆ ecc_ecfp_demontgomery_data_aff()

td_s32 ecc_ecfp_demontgomery_data_aff ( const drv_pke_ecc_point r,
td_u32  work_len 
)

demontgomery data, (ecc_addr_cx, ecc_addr_cy) -> (ecc_addr_cx, ecc_addr_cy). Before calculate demont, you should have set const_1 to ecc_addr_const_1.

参数
rstore the result.
work_lenwork_len = celing(aligned_len/64).
返回
td_s32 TD_SUCCESS or others.

◆ ecc_ecfp_jac_to_aff()

td_s32 ecc_ecfp_jac_to_aff ( const drv_pke_data mod_p)

Get final calculate result. trans (ecc_addr_cx, ecc_addr_cy, ecc_addr_cz) from jac to aff. aff_x = jac_x * ((jac_z)^-2); aff_y = jac_y * ((jac_z)^-3)

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

Create: 2023-06-05

◆ ecc_ecfp_montgomery_data_aff()

td_s32 ecc_ecfp_montgomery_data_aff ( const drv_pke_ecc_point in,
const drv_pke_data mod_p,
const drv_pke_ecc_point *out  CIPHER_CHECK_WORD 
)

montgomery the point coordinate in affine coordinate system. Before call this API, you should have set curve initial parameters into the DRAM.

参数
inintput point in affine coordinate system.
mod_pmodulus.
outoutput point in affine coordinate system.
CIPHER_CHECK_WORDifdef SEC_ENHANCE, the value is XOR result of parameters, otherwise it doesn't exist.
返回
td_s32 TD_SUCCESS or others.

◆ update_modulus()

td_s32 update_modulus ( const td_u8 n,
const td_u32 n_len  CIPHER_CHECK_WORD 
)

update modulus into ecc_addr_m, and set new montgomery parameter into reg. Before call this API, you should have set initial parameters into PKE DRAM.

参数
nthe new modulus
n_lenthe byte length of new modulus.
CIPHER_CHECK_WORDifdef SEC_ENHANCE, the value is XOR result of parameters, otherwise it doesn't exist.
返回
td_s32 TD_SUCCESS or others.