ec_curves.h
Go to the documentation of this file.
1 /**
2  * @file ec_curves.h
3  * @brief Elliptic curves
4  *
5  * @section License
6  *
7  * Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.
8  *
9  * This file is part of CycloneCrypto Open.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24  *
25  * @author Oryx Embedded SARL (www.oryx-embedded.com)
26  * @version 1.9.0
27  **/
28 
29 #ifndef _EC_CURVES_H
30 #define _EC_CURVES_H
31 
32 //Dependencies
33 #include "core/crypto.h"
34 #include "mpi/mpi.h"
35 
36 //secp112r1 elliptic curve support
37 #ifndef SECP112R1_SUPPORT
38  #define SECP112R1_SUPPORT DISABLED
39 #elif (SECP112R1_SUPPORT != ENABLED && SECP112R1_SUPPORT != DISABLED)
40  #error SECP112R1_SUPPORT parameter is not valid
41 #endif
42 
43 //secp112r2 elliptic curve support
44 #ifndef SECP112R2_SUPPORT
45  #define SECP112R2_SUPPORT DISABLED
46 #elif (SECP112R2_SUPPORT != ENABLED && SECP112R2_SUPPORT != DISABLED)
47  #error SECP112R2_SUPPORT parameter is not valid
48 #endif
49 
50 //secp128r1 elliptic curve support
51 #ifndef SECP128R1_SUPPORT
52  #define SECP128R1_SUPPORT DISABLED
53 #elif (SECP128R1_SUPPORT != ENABLED && SECP128R1_SUPPORT != DISABLED)
54  #error SECP128R1_SUPPORT parameter is not valid
55 #endif
56 
57 //secp128r2 elliptic curve support
58 #ifndef SECP128R2_SUPPORT
59  #define SECP128R2_SUPPORT DISABLED
60 #elif (SECP128R2_SUPPORT != ENABLED && SECP128R2_SUPPORT != DISABLED)
61  #error SECP128R2_SUPPORT parameter is not valid
62 #endif
63 
64 //secp160k1 elliptic curve support
65 #ifndef SECP160K1_SUPPORT
66  #define SECP160K1_SUPPORT DISABLED
67 #elif (SECP160K1_SUPPORT != ENABLED && SECP160K1_SUPPORT != DISABLED)
68  #error SECP160K1_SUPPORT parameter is not valid
69 #endif
70 
71 //secp160r1 elliptic curve support
72 #ifndef SECP160R1_SUPPORT
73  #define SECP160R1_SUPPORT DISABLED
74 #elif (SECP160R1_SUPPORT != ENABLED && SECP160R1_SUPPORT != DISABLED)
75  #error SECP160R1_SUPPORT parameter is not valid
76 #endif
77 
78 //secp160r2 elliptic curve support
79 #ifndef SECP160R2_SUPPORT
80  #define SECP160R2_SUPPORT DISABLED
81 #elif (SECP160R2_SUPPORT != ENABLED && SECP160R2_SUPPORT != DISABLED)
82  #error SECP160R2_SUPPORT parameter is not valid
83 #endif
84 
85 //secp192k1 elliptic curve support
86 #ifndef SECP192K1_SUPPORT
87  #define SECP192K1_SUPPORT DISABLED
88 #elif (SECP192K1_SUPPORT != ENABLED && SECP192K1_SUPPORT != DISABLED)
89  #error SECP192K1_SUPPORT parameter is not valid
90 #endif
91 
92 //secp192r1 elliptic curve support (NIST P-192)
93 #ifndef SECP192R1_SUPPORT
94  #define SECP192R1_SUPPORT DISABLED
95 #elif (SECP192R1_SUPPORT != ENABLED && SECP192R1_SUPPORT != DISABLED)
96  #error SECP192R1_SUPPORT parameter is not valid
97 #endif
98 
99 //secp224k1 elliptic curve support
100 #ifndef SECP224K1_SUPPORT
101  #define SECP224K1_SUPPORT DISABLED
102 #elif (SECP224K1_SUPPORT != ENABLED && SECP224K1_SUPPORT != DISABLED)
103  #error SECP224K1_SUPPORT parameter is not valid
104 #endif
105 
106 //secp224r1 elliptic curve support (NIST P-224)
107 #ifndef SECP224R1_SUPPORT
108  #define SECP224R1_SUPPORT ENABLED
109 #elif (SECP224R1_SUPPORT != ENABLED && SECP224R1_SUPPORT != DISABLED)
110  #error SECP224R1_SUPPORT parameter is not valid
111 #endif
112 
113 //secp256k1 elliptic curve support
114 #ifndef SECP256K1_SUPPORT
115  #define SECP256K1_SUPPORT DISABLED
116 #elif (SECP256K1_SUPPORT != ENABLED && SECP256K1_SUPPORT != DISABLED)
117  #error SECP256K1_SUPPORT parameter is not valid
118 #endif
119 
120 //secp256r1 elliptic curve support (NIST P-256)
121 #ifndef SECP256R1_SUPPORT
122  #define SECP256R1_SUPPORT ENABLED
123 #elif (SECP256R1_SUPPORT != ENABLED && SECP256R1_SUPPORT != DISABLED)
124  #error SECP256R1_SUPPORT parameter is not valid
125 #endif
126 
127 //secp384r1 elliptic curve support (NIST P-384)
128 #ifndef SECP384R1_SUPPORT
129  #define SECP384R1_SUPPORT ENABLED
130 #elif (SECP384R1_SUPPORT != ENABLED && SECP384R1_SUPPORT != DISABLED)
131  #error SECP384R1_SUPPORT parameter is not valid
132 #endif
133 
134 //secp521r1 elliptic curve support (NIST P-521)
135 #ifndef SECP521R1_SUPPORT
136  #define SECP521R1_SUPPORT ENABLED
137 #elif (SECP521R1_SUPPORT != ENABLED && SECP521R1_SUPPORT != DISABLED)
138  #error SECP521R1_SUPPORT parameter is not valid
139 #endif
140 
141 //brainpoolP160r1 elliptic curve support
142 #ifndef BRAINPOOLP160R1_SUPPORT
143  #define BRAINPOOLP160R1_SUPPORT DISABLED
144 #elif (BRAINPOOLP160R1_SUPPORT != ENABLED && BRAINPOOLP160R1_SUPPORT != DISABLED)
145  #error BRAINPOOLP160R1_SUPPORT parameter is not valid
146 #endif
147 
148 //brainpoolP192r1 elliptic curve support
149 #ifndef BRAINPOOLP192R1_SUPPORT
150  #define BRAINPOOLP192R1_SUPPORT DISABLED
151 #elif (BRAINPOOLP192R1_SUPPORT != ENABLED && BRAINPOOLP192R1_SUPPORT != DISABLED)
152  #error BRAINPOOLP192R1_SUPPORT parameter is not valid
153 #endif
154 
155 //brainpoolP224r1 elliptic curve support
156 #ifndef BRAINPOOLP224R1_SUPPORT
157  #define BRAINPOOLP224R1_SUPPORT DISABLED
158 #elif (BRAINPOOLP224R1_SUPPORT != ENABLED && BRAINPOOLP224R1_SUPPORT != DISABLED)
159  #error BRAINPOOLP224R1_SUPPORT parameter is not valid
160 #endif
161 
162 //brainpoolP256r1 elliptic curve support
163 #ifndef BRAINPOOLP256R1_SUPPORT
164  #define BRAINPOOLP256R1_SUPPORT DISABLED
165 #elif (BRAINPOOLP256R1_SUPPORT != ENABLED && BRAINPOOLP256R1_SUPPORT != DISABLED)
166  #error BRAINPOOLP256R1_SUPPORT parameter is not valid
167 #endif
168 
169 //brainpoolP320r1 elliptic curve support
170 #ifndef BRAINPOOLP320R1_SUPPORT
171  #define BRAINPOOLP320R1_SUPPORT DISABLED
172 #elif (BRAINPOOLP320R1_SUPPORT != ENABLED && BRAINPOOLP320R1_SUPPORT != DISABLED)
173  #error BRAINPOOLP320R1_SUPPORT parameter is not valid
174 #endif
175 
176 //brainpoolP384r1 elliptic curve support
177 #ifndef BRAINPOOLP384R1_SUPPORT
178  #define BRAINPOOLP384R1_SUPPORT DISABLED
179 #elif (BRAINPOOLP384R1_SUPPORT != ENABLED && BRAINPOOLP384R1_SUPPORT != DISABLED)
180  #error BRAINPOOLP384R1_SUPPORT parameter is not valid
181 #endif
182 
183 //brainpoolP512r1 elliptic curve support
184 #ifndef BRAINPOOLP512R1_SUPPORT
185  #define BRAINPOOLP512R1_SUPPORT DISABLED
186 #elif (BRAINPOOLP512R1_SUPPORT != ENABLED && BRAINPOOLP512R1_SUPPORT != DISABLED)
187  #error BRAINPOOLP512R1_SUPPORT parameter is not valid
188 #endif
189 
190 //Curve25519 elliptic curve support
191 #ifndef X25519_SUPPORT
192  #define X25519_SUPPORT DISABLED
193 #elif (X25519_SUPPORT != ENABLED && X25519_SUPPORT != DISABLED)
194  #error X25519_SUPPORT parameter is not valid
195 #endif
196 
197 //Curve448 elliptic curve support
198 #ifndef X448_SUPPORT
199  #define X448_SUPPORT DISABLED
200 #elif (X448_SUPPORT != ENABLED && X448_SUPPORT != DISABLED)
201  #error X448_SUPPORT parameter is not valid
202 #endif
203 
204 //Ed25519 elliptic curve support
205 #ifndef ED25519_SUPPORT
206  #define ED25519_SUPPORT DISABLED
207 #elif (ED25519_SUPPORT != ENABLED && ED25519_SUPPORT != DISABLED)
208  #error ED25519_SUPPORT parameter is not valid
209 #endif
210 
211 //Ed448 elliptic curve support
212 #ifndef ED448_SUPPORT
213  #define ED448_SUPPORT DISABLED
214 #elif (ED448_SUPPORT != ENABLED && ED448_SUPPORT != DISABLED)
215  #error ED448_SUPPORT parameter is not valid
216 #endif
217 
218 //SECG curves
219 #define SECP112R1_CURVE (&secp112r1Curve)
220 #define SECP112R2_CURVE (&secp112r2Curve)
221 #define SECP128R1_CURVE (&secp128r1Curve)
222 #define SECP128R2_CURVE (&secp128r2Curve)
223 #define SECP160K1_CURVE (&secp160k1Curve)
224 #define SECP160R1_CURVE (&secp160r1Curve)
225 #define SECP160R2_CURVE (&secp160r2Curve)
226 #define SECP192K1_CURVE (&secp192k1Curve)
227 #define SECP192R1_CURVE (&secp192r1Curve)
228 #define SECP224K1_CURVE (&secp224k1Curve)
229 #define SECP224R1_CURVE (&secp224r1Curve)
230 #define SECP256K1_CURVE (&secp256k1Curve)
231 #define SECP256R1_CURVE (&secp256r1Curve)
232 #define SECP384R1_CURVE (&secp384r1Curve)
233 #define SECP521R1_CURVE (&secp521r1Curve)
234 
235 //Brainpool curves
236 #define BRAINPOOLP160R1_CURVE (&brainpoolP160r1Curve)
237 #define BRAINPOOLP192R1_CURVE (&brainpoolP192r1Curve)
238 #define BRAINPOOLP224R1_CURVE (&brainpoolP224r1Curve)
239 #define BRAINPOOLP256R1_CURVE (&brainpoolP256r1Curve)
240 #define BRAINPOOLP320R1_CURVE (&brainpoolP320r1Curve)
241 #define BRAINPOOLP384R1_CURVE (&brainpoolP384r1Curve)
242 #define BRAINPOOLP512R1_CURVE (&brainpoolP512r1Curve)
243 
244 //Montgomery curves
245 #define X25519_CURVE (&x25519Curve)
246 #define X448_CURVE (&x448Curve)
247 
248 //Edwards curves
249 #define ED25519_CURVE (&ed25519Curve)
250 #define ED448_CURVE (&ed448Curve)
251 
252 //C++ guard
253 #ifdef __cplusplus
254  extern "C" {
255 #endif
256 
257 
258 /**
259  * @brief Elliptic curve type
260  **/
261 
262 typedef enum
263 {
276 } EcCurveType;
277 
278 
279 /**
280  * @brief Fast modular reduction
281  **/
282 
283 typedef error_t (*EcFastModAlgo)(Mpi *a, const Mpi *p);
284 
285 
286 /**
287  * @brief Elliptic curve parameters
288  **/
289 
290 typedef struct
291 {
292  const char_t *name; ///<Curve name
293  const uint8_t *oid; ///<Object identifier
294  size_t oidSize; ///<OID size
295  EcCurveType type; ///<Curve type
296  const uint8_t p[66]; ///<Prime modulus p
297  size_t pLen; ///<Length of p
298  const uint8_t a[66]; ///<Curve parameter a
299  size_t aLen; ///<Length of a
300  const uint8_t b[66]; ///<Curve parameter b
301  size_t bLen; ///<Length of b
302  const uint8_t gx[66]; ///<x-coordinate of the base point G
303  size_t gxLen; ///<Length of Gx
304  const uint8_t gy[66]; ///<y-coordinate of the base point G
305  size_t gyLen; ///<Length of Gy
306  const uint8_t q[66]; ///<Order of the base point G
307  size_t qLen; ///<Length of q
308  uint32_t h; ///<Cofactor h
309  EcFastModAlgo mod; ///<Fast modular reduction
310 } EcCurveInfo;
311 
312 
313 //Constants
314 extern const uint8_t SECP112R1_OID[5];
315 extern const uint8_t SECP112R2_OID[5];
316 extern const uint8_t SECP128R1_OID[5];
317 extern const uint8_t SECP128R2_OID[5];
318 extern const uint8_t SECP160K1_OID[5];
319 extern const uint8_t SECP160R1_OID[5];
320 extern const uint8_t SECP160R2_OID[5];
321 extern const uint8_t SECP192K1_OID[5];
322 extern const uint8_t SECP192R1_OID[8];
323 extern const uint8_t SECP224K1_OID[5];
324 extern const uint8_t SECP224R1_OID[5];
325 extern const uint8_t SECP256K1_OID[5];
326 extern const uint8_t SECP256R1_OID[8];
327 extern const uint8_t SECP384R1_OID[5];
328 extern const uint8_t SECP521R1_OID[5];
329 extern const uint8_t BRAINPOOLP160R1_OID[9];
330 extern const uint8_t BRAINPOOLP192R1_OID[9];
331 extern const uint8_t BRAINPOOLP224R1_OID[9];
332 extern const uint8_t BRAINPOOLP256R1_OID[9];
333 extern const uint8_t BRAINPOOLP320R1_OID[9];
334 extern const uint8_t BRAINPOOLP384R1_OID[9];
335 extern const uint8_t BRAINPOOLP512R1_OID[9];
336 extern const uint8_t X25519_OID[3];
337 extern const uint8_t X448_OID[3];
338 extern const uint8_t ED25519_OID[3];
339 extern const uint8_t ED448_OID[3];
340 
341 extern const EcCurveInfo secp112r1Curve;
342 extern const EcCurveInfo secp112r2Curve;
343 extern const EcCurveInfo secp128r1Curve;
344 extern const EcCurveInfo secp128r2Curve;
345 extern const EcCurveInfo secp160k1Curve;
346 extern const EcCurveInfo secp160r1Curve;
347 extern const EcCurveInfo secp160r2Curve;
348 extern const EcCurveInfo secp192k1Curve;
349 extern const EcCurveInfo secp192r1Curve;
350 extern const EcCurveInfo secp224k1Curve;
351 extern const EcCurveInfo secp224r1Curve;
352 extern const EcCurveInfo secp256k1Curve;
353 extern const EcCurveInfo secp256r1Curve;
354 extern const EcCurveInfo secp384r1Curve;
355 extern const EcCurveInfo secp521r1Curve;
356 extern const EcCurveInfo brainpoolP160r1Curve;
357 extern const EcCurveInfo brainpoolP192r1Curve;
358 extern const EcCurveInfo brainpoolP224r1Curve;
359 extern const EcCurveInfo brainpoolP256r1Curve;
360 extern const EcCurveInfo brainpoolP320r1Curve;
361 extern const EcCurveInfo brainpoolP384r1Curve;
362 extern const EcCurveInfo brainpoolP512r1Curve;
363 extern const EcCurveInfo x25519Curve;
364 extern const EcCurveInfo x448Curve;
365 extern const EcCurveInfo ed25519Curve;
366 extern const EcCurveInfo ed448Curve;
367 
368 //Fast modular reduction
369 error_t secp128r1Mod(Mpi *a, const Mpi *p);
370 error_t secp128r2Mod(Mpi *a, const Mpi *p);
371 error_t secp160k1Mod(Mpi *a, const Mpi *p);
372 error_t secp160r1Mod(Mpi *a, const Mpi *p);
373 error_t secp160r2Mod(Mpi *a, const Mpi *p);
374 error_t secp192k1Mod(Mpi *a, const Mpi *p);
375 error_t secp192r1Mod(Mpi *a, const Mpi *p);
376 error_t secp224k1Mod(Mpi *a, const Mpi *p);
377 error_t secp224r1Mod(Mpi *a, const Mpi *p);
378 error_t secp256k1Mod(Mpi *a, const Mpi *p);
379 error_t secp256r1Mod(Mpi *a, const Mpi *p);
380 error_t secp384r1Mod(Mpi *a, const Mpi *p);
381 error_t secp521r1Mod(Mpi *a, const Mpi *p);
382 
383 const EcCurveInfo *ecGetCurveInfo(const uint8_t *oid, size_t length);
384 
385 //C++ guard
386 #ifdef __cplusplus
387  }
388 #endif
389 
390 #endif
const uint8_t X448_OID[3]
Definition: ec_curves.c:92
size_t bLen
Length of b.
Definition: ec_curves.h:301
const EcCurveInfo brainpoolP192r1Curve
brainpoolP192r1 elliptic curve
Definition: ec_curves.c:841
const uint8_t SECP256R1_OID[8]
Definition: ec_curves.c:70
const EcCurveInfo brainpoolP384r1Curve
brainpoolP384r1 elliptic curve
Definition: ec_curves.c:1031
const EcCurveInfo brainpoolP160r1Curve
brainpoolP160r1 elliptic curve
Definition: ec_curves.c:795
const uint8_t ED448_OID[3]
Definition: ec_curves.c:96
size_t qLen
Length of q.
Definition: ec_curves.h:307
Arbitrary precision integer.
Definition: mpi.h:67
char char_t
Definition: compiler_port.h:41
const EcCurveInfo brainpoolP320r1Curve
brainpoolP320r1 elliptic curve
Definition: ec_curves.c:979
const EcCurveInfo secp224r1Curve
secp224r1 elliptic curve
Definition: ec_curves.c:541
const EcCurveInfo secp192k1Curve
secp192k1 elliptic curve
Definition: ec_curves.c:403
const uint8_t BRAINPOOLP512R1_OID[9]
Definition: ec_curves.c:88
EcCurveType type
Curve type.
Definition: ec_curves.h:295
const EcCurveInfo secp521r1Curve
secp521r1 elliptic curve
Definition: ec_curves.c:731
const EcCurveInfo secp128r2Curve
secp128r2 elliptic curve
Definition: ec_curves.c:225
const uint8_t BRAINPOOLP160R1_OID[9]
Definition: ec_curves.c:76
uint8_t p
Definition: ndp.h:295
error_t secp128r2Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp128r2 curve)
Definition: ec_curves.c:1400
General definitions for cryptographic algorithms.
Elliptic curve parameters.
Definition: ec_curves.h:290
const uint8_t SECP192K1_OID[5]
Definition: ec_curves.c:60
const uint8_t ED25519_OID[3]
Definition: ec_curves.c:94
const uint8_t SECP112R2_OID[5]
Definition: ec_curves.c:48
const EcCurveInfo secp160r2Curve
secp160r2 elliptic curve
Definition: ec_curves.c:357
const uint8_t SECP128R2_OID[5]
Definition: ec_curves.c:52
const uint8_t BRAINPOOLP384R1_OID[9]
Definition: ec_curves.c:86
error_t secp160k1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp160k1 curve)
Definition: ec_curves.c:1448
const EcCurveInfo brainpoolP256r1Curve
brainpoolP256r1 elliptic curve
Definition: ec_curves.c:933
uint8_t a
Definition: ndp.h:407
EcFastModAlgo mod
Fast modular reduction.
Definition: ec_curves.h:309
error_t secp256r1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp256r1 curve)
Definition: ec_curves.c:1893
error_t secp192k1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp192k1 curve)
Definition: ec_curves.c:1598
const uint8_t SECP112R1_OID[5]
Definition: ec_curves.c:46
error_t secp128r1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp128r1 curve)
Definition: ec_curves.c:1352
const uint8_t SECP160R1_OID[5]
Definition: ec_curves.c:56
const EcCurveInfo secp384r1Curve
secp384r1 elliptic curve
Definition: ec_curves.c:679
error_t(* EcFastModAlgo)(Mpi *a, const Mpi *p)
Fast modular reduction.
Definition: ec_curves.h:283
size_t gxLen
Length of Gx.
Definition: ec_curves.h:303
const EcCurveInfo secp160k1Curve
secp160k1 elliptic curve
Definition: ec_curves.c:265
size_t gyLen
Length of Gy.
Definition: ec_curves.h:305
error_t secp521r1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp521r1 curve)
Definition: ec_curves.c:2124
const EcCurveInfo secp256k1Curve
secp256k1 elliptic curve
Definition: ec_curves.c:587
const EcCurveInfo secp160r1Curve
secp160r1 elliptic curve
Definition: ec_curves.c:311
const EcCurveInfo secp128r1Curve
secp128r1 elliptic curve
Definition: ec_curves.c:185
size_t pLen
Length of p.
Definition: ec_curves.h:297
const EcCurveInfo secp112r1Curve
secp112r1 elliptic curve
Definition: ec_curves.c:105
error_t secp224k1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp224k1 curve)
Definition: ec_curves.c:1716
error_t secp192r1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp192r1 curve)
Definition: ec_curves.c:1649
const uint8_t * oid
Object identifier.
Definition: ec_curves.h:293
error_t secp160r1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp160r1 curve)
Definition: ec_curves.c:1499
const uint8_t X25519_OID[3]
Definition: ec_curves.c:90
const EcCurveInfo secp192r1Curve
secp192r1 elliptic curve
Definition: ec_curves.c:449
const uint8_t BRAINPOOLP224R1_OID[9]
Definition: ec_curves.c:80
error_t secp256k1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp256k1 curve)
Definition: ec_curves.c:1842
const uint8_t SECP192R1_OID[8]
Definition: ec_curves.c:62
const uint8_t SECP224K1_OID[5]
Definition: ec_curves.c:64
const EcCurveInfo secp112r2Curve
secp112r2 elliptic curve
Definition: ec_curves.c:145
const uint8_t SECP384R1_OID[5]
Definition: ec_curves.c:72
error_t
Error codes.
Definition: error.h:40
MPI (Multiple Precision Integer Arithmetic)
const uint8_t BRAINPOOLP256R1_OID[9]
Definition: ec_curves.c:82
const EcCurveInfo secp224k1Curve
secp224k1 elliptic curve
Definition: ec_curves.c:495
EcCurveType
Elliptic curve type.
Definition: ec_curves.h:262
const uint8_t BRAINPOOLP192R1_OID[9]
Definition: ec_curves.c:78
const uint8_t SECP521R1_OID[5]
Definition: ec_curves.c:74
const uint8_t SECP160R2_OID[5]
Definition: ec_curves.c:58
const uint8_t SECP160K1_OID[5]
Definition: ec_curves.c:54
error_t secp384r1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp384r1 curve)
Definition: ec_curves.c:2009
const EcCurveInfo secp256r1Curve
secp256r1 elliptic curve
Definition: ec_curves.c:633
const EcCurveInfo ed25519Curve
Ed25519 elliptic curve.
Definition: ec_curves.c:1245
const char_t * name
Curve name.
Definition: ec_curves.h:292
const uint8_t SECP128R1_OID[5]
Definition: ec_curves.c:50
error_t secp224r1Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp224r1 curve)
Definition: ec_curves.c:1767
const uint8_t SECP224R1_OID[5]
Definition: ec_curves.c:66
const EcCurveInfo x25519Curve
Curve25519 elliptic curve.
Definition: ec_curves.c:1141
uint8_t length
Definition: dtls_misc.h:140
uint8_t oid[1]
Definition: mib_common.h:184
size_t oidSize
OID size.
Definition: ec_curves.h:294
const uint8_t SECP256K1_OID[5]
Definition: ec_curves.c:68
error_t secp160r2Mod(Mpi *a, const Mpi *p)
Fast modular reduction (secp160r2 curve)
Definition: ec_curves.c:1547
const uint8_t BRAINPOOLP320R1_OID[9]
Definition: ec_curves.c:84
uint8_t b[6]
Definition: dtls_misc.h:130
size_t aLen
Length of a.
Definition: ec_curves.h:299
uint32_t h
Cofactor h.
Definition: ec_curves.h:308
const EcCurveInfo brainpoolP224r1Curve
brainpoolP224r1 elliptic curve
Definition: ec_curves.c:887
const EcCurveInfo brainpoolP512r1Curve
brainpoolP512r1 elliptic curve
Definition: ec_curves.c:1083
const EcCurveInfo * ecGetCurveInfo(const uint8_t *oid, size_t length)
Get the elliptic curve that matches the specified OID.
Definition: ec_curves.c:2170
const EcCurveInfo ed448Curve
Ed448 elliptic curve.
Definition: ec_curves.c:1291
const EcCurveInfo x448Curve
Curve448 elliptic curve.
Definition: ec_curves.c:1187