API参考
载入中...
搜索中...
未找到
asm_ecp_sm2_armv7.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 ASM_ECP_SM2_ARMV7_H
17
#define ASM_ECP_SM2_ARMV7_H
18
19
#include "hitls_build.h"
20
#ifdef HITLS_CRYPTO_CURVE_SM2_ARMV7
21
22
#include <stdint.h>
23
24
#ifdef __cplusplus
25
extern
"C"
{
26
#endif
27
28
#define SM2_BITS 256
29
#define SM2_BYTES 64
30
#define SM2_LIMBS 8
31
36
typedef
uint32_t Sm2Fp[SM2_LIMBS];
37
42
typedef
struct
SM2Point{
43
Sm2Fp x;
44
Sm2Fp y;
45
Sm2Fp z;
46
} Sm2Point;
47
54
int32_t ECP_Sm2FpCmp(
const
Sm2Fp a,
const
Sm2Fp b);
55
62
void
ECP_Sm2FpAdd(Sm2Fp r,
const
Sm2Fp a,
const
Sm2Fp b);
63
70
void
ECP_Sm2FpSub(Sm2Fp r,
const
Sm2Fp a,
const
Sm2Fp b);
71
77
void
ECP_Sm2FpNeg(Sm2Fp r,
const
Sm2Fp a);
78
84
void
ECP_Sm2FpHaf(Sm2Fp r,
const
Sm2Fp a);
85
91
92
void
ECP_Sm2FpDou(Sm2Fp r,
const
Sm2Fp a);
93
100
void
ECP_Sm2FpMul(Sm2Fp r,
const
Sm2Fp a,
const
Sm2Fp b);
101
107
void
ECP_Sm2FpSqr(Sm2Fp r,
const
Sm2Fp a);
108
115
void
ECP_Sm2FnAdd(Sm2Fp r,
const
Sm2Fp a,
const
Sm2Fp b);
116
123
void
ECP_Sm2FnSub(Sm2Fp r,
const
Sm2Fp a,
const
Sm2Fp b);
124
130
void
ECP_Sm2FnHaf(Sm2Fp r,
const
Sm2Fp a);
131
138
void
ECP_Sm2FnMul(Sm2Fp r,
const
Sm2Fp a,
const
Sm2Fp b);
139
140
#ifdef __cplusplus
141
}
142
#endif
143
144
#endif
145
#endif
//ASM_ECP_SM2_ARMV7_H
crypto
ecc
src
asm_ecp_sm2_armv7.h
制作者
1.15.0