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

宏定义

#define ECC_MAX_LEN   (DRV_PKE_LEN_576 * 2)
 

函数

td_s32 get_random_key (const td_u8 *n, const td_u32 size, td_u8 *rand CIPHER_CHECK_WORD)
 Get the random key object range in [1, n-1]
 
td_s32 ecc_ecfp_aff_to_jac (const drv_pke_ecc_point *in, const drv_pke_data *mod_p, pke_ecc_point_jac *out)
 trans coordinate system from affine to jacobin, before call this API, you should have set mont_1_p and const_0 into ecc_addr_mont_1_p and ecc_addr_const_0. (ecc_addr_px, ecc_addr_py) -> (ecc_addr_cx, ecc_addr_cy, ecc_addr_cz).
 
td_s32 ecc_ecfp_mul_naf_cal (td_u32 work_len, const drv_pke_data *k)
 R = k * G, point multiplication. Before call this API, you should have set curve initial parameters, and set point coordinate into the DRAM.
 
td_s32 ecc_ecfp_mul_naf (const drv_pke_ecc_curve *ecc, const drv_pke_data *k, const drv_pke_ecc_point *p, const drv_pke_ecc_point *r CIPHER_CHECK_WORD)
 R = k * G, point multiplication.
 

宏定义说明

◆ ECC_MAX_LEN

#define ECC_MAX_LEN   (DRV_PKE_LEN_576 * 2)

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

Create: 2023-06-05

函数说明

◆ ecc_ecfp_aff_to_jac()

td_s32 ecc_ecfp_aff_to_jac ( const drv_pke_ecc_point in,
const drv_pke_data mod_p,
pke_ecc_point_jac out 
)

trans coordinate system from affine to jacobin, before call this API, you should have set mont_1_p and const_0 into ecc_addr_mont_1_p and ecc_addr_const_0. (ecc_addr_px, ecc_addr_py) -> (ecc_addr_cx, ecc_addr_cy, ecc_addr_cz).

参数
inthe input point in affine system.
mod_pthe modulur.
返回
td_s32 TD_SUCCESS or others.

◆ ecc_ecfp_mul_naf()

td_s32 ecc_ecfp_mul_naf ( const drv_pke_ecc_curve ecc,
const drv_pke_data k,
const drv_pke_ecc_point p,
const drv_pke_ecc_point *r  CIPHER_CHECK_WORD 
)

R = k * G, point multiplication.

参数
eccinput ecc curve param.
kthe scalar.
pthe input point.
rthe output point.
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_mul_naf_cal()

td_s32 ecc_ecfp_mul_naf_cal ( td_u32  work_len,
const drv_pke_data k 
)

R = k * G, point multiplication. Before call this API, you should have set curve initial parameters, and set point coordinate into the DRAM.

参数
work_lenwork_len = align_len / ALIGNED_TO_WORK_LEN_IN_BYTE.
kthe scalar.
返回
td_s32 TD_SUCCESS or others.

◆ get_random_key()

td_s32 get_random_key ( const td_u8 n,
const td_u32  size,
td_u8 *rand  CIPHER_CHECK_WORD 
)

Get the random key object range in [1, n-1]

参数
nrange.
sizethe byte length of number n.
randthe output random data.
CIPHER_CHECK_WORDifdef SEC_ENHANCE, the value is XOR result of parameters, otherwise it doesn't exist.
返回
td_s32 TD_SUCCESS or others.