Go to the documentation of this file.
39 #ifndef SECP112R1_SUPPORT
40 #define SECP112R1_SUPPORT DISABLED
41 #elif (SECP112R1_SUPPORT != ENABLED && SECP112R1_SUPPORT != DISABLED)
42 #error SECP112R1_SUPPORT parameter is not valid
46 #ifndef SECP112R2_SUPPORT
47 #define SECP112R2_SUPPORT DISABLED
48 #elif (SECP112R2_SUPPORT != ENABLED && SECP112R2_SUPPORT != DISABLED)
49 #error SECP112R2_SUPPORT parameter is not valid
53 #ifndef SECP128R1_SUPPORT
54 #define SECP128R1_SUPPORT DISABLED
55 #elif (SECP128R1_SUPPORT != ENABLED && SECP128R1_SUPPORT != DISABLED)
56 #error SECP128R1_SUPPORT parameter is not valid
60 #ifndef SECP128R2_SUPPORT
61 #define SECP128R2_SUPPORT DISABLED
62 #elif (SECP128R2_SUPPORT != ENABLED && SECP128R2_SUPPORT != DISABLED)
63 #error SECP128R2_SUPPORT parameter is not valid
67 #ifndef SECP160K1_SUPPORT
68 #define SECP160K1_SUPPORT DISABLED
69 #elif (SECP160K1_SUPPORT != ENABLED && SECP160K1_SUPPORT != DISABLED)
70 #error SECP160K1_SUPPORT parameter is not valid
74 #ifndef SECP160R1_SUPPORT
75 #define SECP160R1_SUPPORT DISABLED
76 #elif (SECP160R1_SUPPORT != ENABLED && SECP160R1_SUPPORT != DISABLED)
77 #error SECP160R1_SUPPORT parameter is not valid
81 #ifndef SECP160R2_SUPPORT
82 #define SECP160R2_SUPPORT DISABLED
83 #elif (SECP160R2_SUPPORT != ENABLED && SECP160R2_SUPPORT != DISABLED)
84 #error SECP160R2_SUPPORT parameter is not valid
88 #ifndef SECP192K1_SUPPORT
89 #define SECP192K1_SUPPORT DISABLED
90 #elif (SECP192K1_SUPPORT != ENABLED && SECP192K1_SUPPORT != DISABLED)
91 #error SECP192K1_SUPPORT parameter is not valid
95 #ifndef SECP192R1_SUPPORT
96 #define SECP192R1_SUPPORT DISABLED
97 #elif (SECP192R1_SUPPORT != ENABLED && SECP192R1_SUPPORT != DISABLED)
98 #error SECP192R1_SUPPORT parameter is not valid
102 #ifndef SECP224K1_SUPPORT
103 #define SECP224K1_SUPPORT DISABLED
104 #elif (SECP224K1_SUPPORT != ENABLED && SECP224K1_SUPPORT != DISABLED)
105 #error SECP224K1_SUPPORT parameter is not valid
109 #ifndef SECP224R1_SUPPORT
110 #define SECP224R1_SUPPORT ENABLED
111 #elif (SECP224R1_SUPPORT != ENABLED && SECP224R1_SUPPORT != DISABLED)
112 #error SECP224R1_SUPPORT parameter is not valid
116 #ifndef SECP256K1_SUPPORT
117 #define SECP256K1_SUPPORT DISABLED
118 #elif (SECP256K1_SUPPORT != ENABLED && SECP256K1_SUPPORT != DISABLED)
119 #error SECP256K1_SUPPORT parameter is not valid
123 #ifndef SECP256R1_SUPPORT
124 #define SECP256R1_SUPPORT ENABLED
125 #elif (SECP256R1_SUPPORT != ENABLED && SECP256R1_SUPPORT != DISABLED)
126 #error SECP256R1_SUPPORT parameter is not valid
130 #ifndef SECP384R1_SUPPORT
131 #define SECP384R1_SUPPORT ENABLED
132 #elif (SECP384R1_SUPPORT != ENABLED && SECP384R1_SUPPORT != DISABLED)
133 #error SECP384R1_SUPPORT parameter is not valid
137 #ifndef SECP521R1_SUPPORT
138 #define SECP521R1_SUPPORT ENABLED
139 #elif (SECP521R1_SUPPORT != ENABLED && SECP521R1_SUPPORT != DISABLED)
140 #error SECP521R1_SUPPORT parameter is not valid
144 #ifndef BRAINPOOLP160R1_SUPPORT
145 #define BRAINPOOLP160R1_SUPPORT DISABLED
146 #elif (BRAINPOOLP160R1_SUPPORT != ENABLED && BRAINPOOLP160R1_SUPPORT != DISABLED)
147 #error BRAINPOOLP160R1_SUPPORT parameter is not valid
151 #ifndef BRAINPOOLP192R1_SUPPORT
152 #define BRAINPOOLP192R1_SUPPORT DISABLED
153 #elif (BRAINPOOLP192R1_SUPPORT != ENABLED && BRAINPOOLP192R1_SUPPORT != DISABLED)
154 #error BRAINPOOLP192R1_SUPPORT parameter is not valid
158 #ifndef BRAINPOOLP224R1_SUPPORT
159 #define BRAINPOOLP224R1_SUPPORT DISABLED
160 #elif (BRAINPOOLP224R1_SUPPORT != ENABLED && BRAINPOOLP224R1_SUPPORT != DISABLED)
161 #error BRAINPOOLP224R1_SUPPORT parameter is not valid
165 #ifndef BRAINPOOLP256R1_SUPPORT
166 #define BRAINPOOLP256R1_SUPPORT DISABLED
167 #elif (BRAINPOOLP256R1_SUPPORT != ENABLED && BRAINPOOLP256R1_SUPPORT != DISABLED)
168 #error BRAINPOOLP256R1_SUPPORT parameter is not valid
172 #ifndef BRAINPOOLP320R1_SUPPORT
173 #define BRAINPOOLP320R1_SUPPORT DISABLED
174 #elif (BRAINPOOLP320R1_SUPPORT != ENABLED && BRAINPOOLP320R1_SUPPORT != DISABLED)
175 #error BRAINPOOLP320R1_SUPPORT parameter is not valid
179 #ifndef BRAINPOOLP384R1_SUPPORT
180 #define BRAINPOOLP384R1_SUPPORT DISABLED
181 #elif (BRAINPOOLP384R1_SUPPORT != ENABLED && BRAINPOOLP384R1_SUPPORT != DISABLED)
182 #error BRAINPOOLP384R1_SUPPORT parameter is not valid
186 #ifndef BRAINPOOLP512R1_SUPPORT
187 #define BRAINPOOLP512R1_SUPPORT DISABLED
188 #elif (BRAINPOOLP512R1_SUPPORT != ENABLED && BRAINPOOLP512R1_SUPPORT != DISABLED)
189 #error BRAINPOOLP512R1_SUPPORT parameter is not valid
193 #ifndef FRP256V1_SUPPORT
194 #define FRP256V1_SUPPORT DISABLED
195 #elif (FRP256V1_SUPPORT != ENABLED && FRP256V1_SUPPORT != DISABLED)
196 #error FRP256V1_SUPPORT parameter is not valid
201 #define SM2_SUPPORT DISABLED
202 #elif (SM2_SUPPORT != ENABLED && SM2_SUPPORT != DISABLED)
203 #error SM2_SUPPORT parameter is not valid
207 #ifndef X25519_SUPPORT
208 #define X25519_SUPPORT DISABLED
209 #elif (X25519_SUPPORT != ENABLED && X25519_SUPPORT != DISABLED)
210 #error X25519_SUPPORT parameter is not valid
215 #define X448_SUPPORT DISABLED
216 #elif (X448_SUPPORT != ENABLED && X448_SUPPORT != DISABLED)
217 #error X448_SUPPORT parameter is not valid
221 #ifndef ED25519_SUPPORT
222 #define ED25519_SUPPORT DISABLED
223 #elif (ED25519_SUPPORT != ENABLED && ED25519_SUPPORT != DISABLED)
224 #error ED25519_SUPPORT parameter is not valid
228 #ifndef ED448_SUPPORT
229 #define ED448_SUPPORT DISABLED
230 #elif (ED448_SUPPORT != ENABLED && ED448_SUPPORT != DISABLED)
231 #error ED448_SUPPORT parameter is not valid
235 #define SECP112R1_CURVE (&secp112r1Curve)
236 #define SECP112R2_CURVE (&secp112r2Curve)
237 #define SECP128R1_CURVE (&secp128r1Curve)
238 #define SECP128R2_CURVE (&secp128r2Curve)
239 #define SECP160K1_CURVE (&secp160k1Curve)
240 #define SECP160R1_CURVE (&secp160r1Curve)
241 #define SECP160R2_CURVE (&secp160r2Curve)
242 #define SECP192K1_CURVE (&secp192k1Curve)
243 #define SECP192R1_CURVE (&secp192r1Curve)
244 #define SECP224K1_CURVE (&secp224k1Curve)
245 #define SECP224R1_CURVE (&secp224r1Curve)
246 #define SECP256K1_CURVE (&secp256k1Curve)
247 #define SECP256R1_CURVE (&secp256r1Curve)
248 #define SECP384R1_CURVE (&secp384r1Curve)
249 #define SECP521R1_CURVE (&secp521r1Curve)
250 #define BRAINPOOLP160R1_CURVE (&brainpoolP160r1Curve)
251 #define BRAINPOOLP192R1_CURVE (&brainpoolP192r1Curve)
252 #define BRAINPOOLP224R1_CURVE (&brainpoolP224r1Curve)
253 #define BRAINPOOLP256R1_CURVE (&brainpoolP256r1Curve)
254 #define BRAINPOOLP320R1_CURVE (&brainpoolP320r1Curve)
255 #define BRAINPOOLP384R1_CURVE (&brainpoolP384r1Curve)
256 #define BRAINPOOLP512R1_CURVE (&brainpoolP512r1Curve)
257 #define SM2_CURVE (&sm2Curve)
258 #define X25519_CURVE (&x25519Curve)
259 #define X448_CURVE (&x448Curve)
260 #define ED25519_CURVE (&ed25519Curve)
261 #define ED448_CURVE (&ed448Curve)
313 const uint8_t gx[66];
315 const uint8_t gy[66];
348 extern const uint8_t
SM2_OID[8];
const uint8_t BRAINPOOLP224R1_OID[9]
error_t secp256k1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp256k1 curve)
const EcCurveInfo brainpoolP256r1Curve
brainpoolP256r1 elliptic curve
error_t brainpoolP256r1Mod(Mpi *a, const Mpi *p)
error_t secp521r1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp521r1 curve)
Arbitrary precision integer.
error_t secp192k1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp192k1 curve)
const EcCurveInfo secp160k1Curve
secp160k1 elliptic curve
error_t frp256v1Mod(Mpi *a, const Mpi *p)
const uint8_t BRAINPOOLP256R1_OID[9]
const EcCurveInfo secp224k1Curve
secp224k1 elliptic curve
const EcCurveInfo frp256v1Curve
FRP256v1 elliptic curve.
const EcCurveInfo brainpoolP512r1Curve
brainpoolP512r1 elliptic curve
const uint8_t X448_OID[3]
const uint8_t * oid
Object identifier.
error_t secp160k1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp160k1 curve)
error_t brainpoolP512r1Mod(Mpi *a, const Mpi *p)
error_t secp224k1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp224k1 curve)
error_t secp192r1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp192r1 curve)
const uint8_t BRAINPOOLP320R1_OID[9]
error_t brainpoolP320r1Mod(Mpi *a, const Mpi *p)
const EcCurveInfo secp224r1Curve
secp224r1 elliptic curve
error_t secp160r2Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp160r2 curve)
const uint8_t SECP160R2_OID[5]
const EcCurveInfo secp112r1Curve
secp112r1 elliptic curve
error_t secp160r1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp160r1 curve)
const EcCurveInfo x448Curve
Curve448 elliptic curve.
const uint8_t SECP128R1_OID[5]
const EcCurveInfo brainpoolP384r1Curve
brainpoolP384r1 elliptic curve
const EcCurveInfo x25519Curve
Curve25519 elliptic curve.
Elliptic curve parameters.
const uint8_t SECP192R1_OID[8]
const EcCurveInfo brainpoolP320r1Curve
brainpoolP320r1 elliptic curve
const EcCurveInfo secp256r1Curve
secp256r1 elliptic curve
const uint8_t SECP384R1_OID[5]
const EcCurveInfo ed448Curve
Ed448 elliptic curve.
const EcCurveInfo secp112r2Curve
secp112r2 elliptic curve
error_t brainpoolP384r1Mod(Mpi *a, const Mpi *p)
const uint8_t SECP256R1_OID[8]
const EcCurveInfo brainpoolP224r1Curve
brainpoolP224r1 elliptic curve
const uint8_t SECP160K1_OID[5]
error_t secp224r1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp224r1 curve)
EcFastModAlgo mod
Fast modular reduction.
MPI (Multiple Precision Integer Arithmetic)
const uint8_t SECP160R1_OID[5]
General definitions for cryptographic algorithms.
const uint8_t SECP224K1_OID[5]
const uint8_t ED448_OID[3]
const EcCurveInfo brainpoolP192r1Curve
brainpoolP192r1 elliptic curve
const uint8_t SECP521R1_OID[5]
const uint8_t SECP112R2_OID[5]
const uint8_t SECP256K1_OID[5]
error_t sm2Mod(Mpi *a, const Mpi *p)
Fast modular reduction (SM2 curve)
size_t gyLen
Length of Gy.
error_t brainpoolP192r1Mod(Mpi *a, const Mpi *p)
const char_t * name
Curve name.
error_t brainpoolP224r1Mod(Mpi *a, const Mpi *p)
const uint8_t ED25519_OID[3]
const EcCurveInfo ed25519Curve
Ed25519 elliptic curve.
const EcCurveInfo secp521r1Curve
secp521r1 elliptic curve
error_t secp256r1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp256r1 curve)
const uint8_t FRP256V1_OID[10]
error_t secp384r1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp384r1 curve)
const uint8_t X25519_OID[3]
const EcCurveInfo secp128r2Curve
secp128r2 elliptic curve
error_t secp128r2Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp128r2 curve)
const uint8_t BRAINPOOLP384R1_OID[9]
const EcCurveInfo sm2Curve
SM2 elliptic curve.
const EcCurveInfo secp128r1Curve
secp128r1 elliptic curve
const uint8_t SECP128R2_OID[5]
const EcCurveInfo secp192r1Curve
secp192r1 elliptic curve
const EcCurveInfo secp384r1Curve
secp384r1 elliptic curve
const EcCurveInfo secp160r2Curve
secp160r2 elliptic curve
const EcCurveInfo * ecGetCurveInfo(const uint8_t *oid, size_t length)
Get the elliptic curve that matches the specified OID.
const uint8_t SECP192K1_OID[5]
const uint8_t BRAINPOOLP160R1_OID[9]
size_t gxLen
Length of Gx.
const uint8_t SECP112R1_OID[5]
const EcCurveInfo secp192k1Curve
secp192k1 elliptic curve
error_t(* EcFastModAlgo)(Mpi *a, const Mpi *p)
Fast modular reduction.
const EcCurveInfo secp160r1Curve
secp160r1 elliptic curve
EcCurveType
Elliptic curve type.
const uint8_t BRAINPOOLP512R1_OID[9]
const uint8_t BRAINPOOLP192R1_OID[9]
@ EC_CURVE_TYPE_BRAINPOOLP_R1
error_t secp128r1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp128r1 curve)
const uint8_t SECP224R1_OID[5]
const EcCurveInfo brainpoolP160r1Curve
brainpoolP160r1 elliptic curve
EcCurveType type
Curve type.
const EcCurveInfo secp256k1Curve
secp256k1 elliptic curve
error_t brainpoolP160r1Mod(Mpi *a, const Mpi *p)