|
WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
|
#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"
宏定义 | |
| #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. | |
| #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
| 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).
| in | the input point in affine system. |
| mod_p | the modulur. |
| 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 | input ecc curve param. |
| k | the scalar. |
| p | the input point. |
| r | the output point. |
| CIPHER_CHECK_WORD | ifdef SEC_ENHANCE, the value is XOR result of parameters, otherwise it doesn't exist. |
| 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_len | work_len = align_len / ALIGNED_TO_WORK_LEN_IN_BYTE. |
| k | the scalar. |
Get the random key object range in [1, n-1]
| n | range. |
| size | the byte length of number n. |
| rand | the output random data. |
| CIPHER_CHECK_WORD | ifdef SEC_ENHANCE, the value is XOR result of parameters, otherwise it doesn't exist. |