WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
curve_ec_fp.h 文件参考
curve_ec_fp.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

函数

td_s32 decode_priv_key (td_u8 *output_key, const td_u8 *input_key, td_u32 klen)
 decode the normal k value. In RFC7748, the k value and point on curve are all encoded.
 
td_s32 decode_point_x (td_u8 *output_u_x, const td_u8 *input_u_x, td_u32 ulen)
 decode the x coordinate of the point. In RFC7748, the k value and point on curve are all encoded.
 
td_s32 encode_point_x (td_u8 *output_u_x, const td_u8 *input_u_x, td_u32 ulen)
 encode the x coordinate of the point. In RFC7748, the k value and point on curve are all encoded.
 
td_s32 curve_ecfp_mul (const drv_pke_ecc_curve *ecc, const drv_pke_data *k, const drv_pke_data *ux, const drv_pke_data *rx)
 Rx = k * ux. calculate point multiplication for curve25519 and curve448. before call this API you should have decoded the k value and the x coordinate of the point. after call this API, if you will transfer the rx to user, you should encode the rx by yourself.
 
td_s32 curve_ecfp_mul_dot (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)
 rx = k * px. calculate point multiplication for curve25519 and curve448.
 

函数说明

◆ curve_ecfp_mul()

td_s32 curve_ecfp_mul ( const drv_pke_ecc_curve ecc,
const drv_pke_data k,
const drv_pke_data ux,
const drv_pke_data rx 
)

Rx = k * ux. calculate point multiplication for curve25519 and curve448. before call this API you should have decoded the k value and the x coordinate of the point. after call this API, if you will transfer the rx to user, you should encode the rx by yourself.

参数
eccthe ecc curve param.
kthe input decoded normal k value.
uxthe intput decoded x coordinate of the point.
rxthe output without encoded x coordinate of the point.
返回
td_s32 TD_SUCCESS or others.

◆ curve_ecfp_mul_dot()

td_s32 curve_ecfp_mul_dot ( 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 
)

rx = k * px. calculate point multiplication for curve25519 and curve448.

参数
eccThe ecc curve param.
kThe input decoded normal k value.
pThe intput decoded x coordinate of the point.
CIPHER_CHECK_WORDifdef SEC_ENHANCE, the value is XOR result of parameters, otherwise it doesn't exist.
返回
td_s32 TD_SUCCESS or others.

◆ decode_point_x()

td_s32 decode_point_x ( td_u8 output_u_x,
const td_u8 input_u_x,
td_u32  ulen 
)

decode the x coordinate of the point. In RFC7748, the k value and point on curve are all encoded.

参数
output_u_xthe decoded x coordinate of the point, which can be used in calculation directly.
input_u_xthe input encoded x coordinate of the point.
ulenthe byte length of x coordinate of the point.
返回
td_s32 TD_SUCCESS or others.

◆ decode_priv_key()

td_s32 decode_priv_key ( td_u8 output_key,
const td_u8 input_key,
td_u32  klen 
)

decode the normal k value. In RFC7748, the k value and point on curve are all encoded.

Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2022-2022. All rights reserved. Description: the curve drv common algorithm head file. The data will transfor by the func param and will be set into DRAM in the algorithms.

Create: 2022-10-27

参数
output_keythe decoded k value, which can be used in calculation directly.
input_keythe input encoded k value.
klenthe byte length of k value.
返回
td_s32 TD_SUCCESS or others.

◆ encode_point_x()

td_s32 encode_point_x ( td_u8 output_u_x,
const td_u8 input_u_x,
td_u32  ulen 
)

encode the x coordinate of the point. In RFC7748, the k value and point on curve are all encoded.

参数
output_u_xthe encoded x coordinate of the point, which will be transfered to user.
input_u_xthe input x coordinate of the point.
ulenthe byte length of x coordinate of the point.
返回
td_s32 TD_SUCCESS or others.