API参考
载入中...
搜索中...
未找到
sm9_fp12.h
1/*
2 * This file is part of the openHiTLS project.
3 *
4 * openHiTLS is licensed under the Mulan PSL v2.
5 * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 * You may obtain a copy of Mulan PSL v2 at:
7 *
8 * http://license.coscl.org.cn/MulanPSL2
9 *
10 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13 * See the Mulan PSL v2 for more details.
14 */
15
16#ifndef _SM9_FP12_H_
17#define _SM9_FP12_H_
18
19#include "hitls_build.h"
20#ifdef HITLS_CRYPTO_SM9
21
22#include "sm9_fp4.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28void SM9_Fp12_ReadBytes(SM9_Fp12 *dst, const uint8_t *src);
29
30void SM9_Fp12_WriteBytes(uint8_t *dst, SM9_Fp12 *src);
31
32void SM9_Fp12_Reset(SM9_Fp12 *pFp12_E);
33void SM9_Fp12_Assign(SM9_Fp12 *pDest, SM9_Fp12 *pSource);
34void SM9_Fp12_SetOne(SM9_Fp12 *pFp12_E);
35
36// pFp12_Prod = pFp12_A * pFp12_B mod pBN_M
37void SM9_Fp12_Mul(SM9_Fp12 *pFp12_R, SM9_Fp12 *pFp12_A, SM9_Fp12 *pFp12_B);
38// pFp12_Prod = pFp12_A ^ 2 mod pBN_M
39void SM9_Fp12_Squ(SM9_Fp12 *pFp12_R, SM9_Fp12 *pFp12_A);
40// pFp12_Res = pFp12_A ^ -1 mod pBN_M
41void SM9_Fp12_Inv(SM9_Fp12 *pFp12_R, SM9_Fp12 *pFp12_A);
42// pFp12_Res = pFp12_X ^ pBN_E mod pBN_M
43void SM9_Fp12_Exp(SM9_Fp12 *pFp12_R, SM9_Fp12 *pFp12_A, uint32_t *pBn_E);
44
45void SM9_Fp12_FrobMap(SM9_Fp12 *pFp12_R, SM9_Fp12 *pFp12_A);
46
47void SM9_Fp12_Mul_For_MillerLoop(SM9_Fp12 *pFp12_R, SM9_Fp12 *pFp12_A, SM9_Fp12 *pFp12_B);
48
49void SM9_Fp12_Mul_For_FrobMap(SM9_Fp12 *pFp12_R, SM9_Fp12 *pFp12_A, SM9_Fp12 *pFp12_B);
50
51void SM9_Fp12_GetConj(SM9_Fp12 *pwRes, SM9_Fp12 *pwA);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif // HITLS_CRYPTO_SM9
58
59#endif // !_SM9_FP12_H_
60