1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5#ifndef __ecl_exp_h_
6#define __ecl_exp_h_
7
8/* Curve field type */
9typedef enum {
10 ECField_GFp,
11 ECField_GF2m
12} ECField;
13
14/* Hexadecimal encoding of curve parameters */
15struct ECCurveParamsStr {
16 char *text;
17 ECField field;
18 unsigned int size;
19 char *irr;
20 char *curvea;
21 char *curveb;
22 char *genx;
23 char *geny;
24 char *order;
25 int cofactor;
26 int security;
27 int pointSize;
28 unsigned int usage;
29};
30typedef struct ECCurveParamsStr ECCurveParams;
31
32/* Named curve parameters */
33typedef enum {
34
35 ECCurve_noName = 0,
36
37 /* NIST prime curves */
38 ECCurve_NIST_P192, /* not supported */
39 ECCurve_NIST_P224, /* not supported */
40 ECCurve_NIST_P256,
41 ECCurve_NIST_P384,
42 ECCurve_NIST_P521,
43
44 /* NIST binary curves */
45 ECCurve_NIST_K163, /* not supported */
46 ECCurve_NIST_B163, /* not supported */
47 ECCurve_NIST_K233, /* not supported */
48 ECCurve_NIST_B233, /* not supported */
49 ECCurve_NIST_K283, /* not supported */
50 ECCurve_NIST_B283, /* not supported */
51 ECCurve_NIST_K409, /* not supported */
52 ECCurve_NIST_B409, /* not supported */
53 ECCurve_NIST_K571, /* not supported */
54 ECCurve_NIST_B571, /* not supported */
55
56 /* ANSI X9.62 prime curves */
57 /* ECCurve_X9_62_PRIME_192V1 == ECCurve_NIST_P192 */
58 ECCurve_X9_62_PRIME_192V2, /* not supported */
59 ECCurve_X9_62_PRIME_192V3, /* not supported */
60 ECCurve_X9_62_PRIME_239V1, /* not supported */
61 ECCurve_X9_62_PRIME_239V2, /* not supported */
62 ECCurve_X9_62_PRIME_239V3, /* not supported */
63 /* ECCurve_X9_62_PRIME_256V1 == ECCurve_NIST_P256 */
64
65 /* ANSI X9.62 binary curves */
66 ECCurve_X9_62_CHAR2_PNB163V1, /* not supported */
67 ECCurve_X9_62_CHAR2_PNB163V2, /* not supported */
68 ECCurve_X9_62_CHAR2_PNB163V3, /* not supported */
69 ECCurve_X9_62_CHAR2_PNB176V1, /* not supported */
70 ECCurve_X9_62_CHAR2_TNB191V1, /* not supported */
71 ECCurve_X9_62_CHAR2_TNB191V2, /* not supported */
72 ECCurve_X9_62_CHAR2_TNB191V3, /* not supported */
73 ECCurve_X9_62_CHAR2_PNB208W1, /* not supported */
74 ECCurve_X9_62_CHAR2_TNB239V1, /* not supported */
75 ECCurve_X9_62_CHAR2_TNB239V2, /* not supported */
76 ECCurve_X9_62_CHAR2_TNB239V3, /* not supported */
77 ECCurve_X9_62_CHAR2_PNB272W1, /* not supported */
78 ECCurve_X9_62_CHAR2_PNB304W1, /* not supported */
79 ECCurve_X9_62_CHAR2_TNB359V1, /* not supported */
80 ECCurve_X9_62_CHAR2_PNB368W1, /* not supported */
81 ECCurve_X9_62_CHAR2_TNB431R1, /* not supported */
82
83 /* SEC2 prime curves */
84 ECCurve_SECG_PRIME_112R1, /* not supported */
85 ECCurve_SECG_PRIME_112R2, /* not supported */
86 ECCurve_SECG_PRIME_128R1, /* not supported */
87 ECCurve_SECG_PRIME_128R2, /* not supported */
88 ECCurve_SECG_PRIME_160K1, /* not supported */
89 ECCurve_SECG_PRIME_160R1, /* not supported */
90 ECCurve_SECG_PRIME_160R2, /* not supported */
91 ECCurve_SECG_PRIME_192K1, /* not supported */
92 /* ECCurve_SECG_PRIME_192R1 == ECCurve_NIST_P192 */
93 ECCurve_SECG_PRIME_224K1, /* not supported */
94 /* ECCurve_SECG_PRIME_224R1 == ECCurve_NIST_P224 */
95 ECCurve_SECG_PRIME_256K1, /* not supported */
96 /* ECCurve_SECG_PRIME_256R1 == ECCurve_NIST_P256 */
97 /* ECCurve_SECG_PRIME_384R1 == ECCurve_NIST_P384 */
98 /* ECCurve_SECG_PRIME_521R1 == ECCurve_NIST_P521 */
99
100 /* SEC2 binary curves */
101 ECCurve_SECG_CHAR2_113R1, /* not supported */
102 ECCurve_SECG_CHAR2_113R2, /* not supported */
103 ECCurve_SECG_CHAR2_131R1, /* not supported */
104 ECCurve_SECG_CHAR2_131R2, /* not supported */
105 /* ECCurve_SECG_CHAR2_163K1 == ECCurve_NIST_K163 */
106 ECCurve_SECG_CHAR2_163R1, /* not supported */
107 /* ECCurve_SECG_CHAR2_163R2 == ECCurve_NIST_B163 */
108 ECCurve_SECG_CHAR2_193R1, /* not supported */
109 ECCurve_SECG_CHAR2_193R2, /* not supported */
110 /* ECCurve_SECG_CHAR2_233K1 == ECCurve_NIST_K233 */
111 /* ECCurve_SECG_CHAR2_233R1 == ECCurve_NIST_B233 */
112 ECCurve_SECG_CHAR2_239K1, /* not supported */
113 /* ECCurve_SECG_CHAR2_283K1 == ECCurve_NIST_K283 */
114 /* ECCurve_SECG_CHAR2_283R1 == ECCurve_NIST_B283 */
115 /* ECCurve_SECG_CHAR2_409K1 == ECCurve_NIST_K409 */
116 /* ECCurve_SECG_CHAR2_409R1 == ECCurve_NIST_B409 */
117 /* ECCurve_SECG_CHAR2_571K1 == ECCurve_NIST_K571 */
118 /* ECCurve_SECG_CHAR2_571R1 == ECCurve_NIST_B571 */
119
120 /* WTLS curves */
121 ECCurve_WTLS_1, /* not supported */
122 /* there is no WTLS 2 curve */
123 /* ECCurve_WTLS_3 == ECCurve_NIST_K163 */
124 /* ECCurve_WTLS_4 == ECCurve_SECG_CHAR2_113R1 */
125 /* ECCurve_WTLS_5 == ECCurve_X9_62_CHAR2_PNB163V1 */
126 /* ECCurve_WTLS_6 == ECCurve_SECG_PRIME_112R1 */
127 /* ECCurve_WTLS_7 == ECCurve_SECG_PRIME_160R1 */
128 ECCurve_WTLS_8, /* not supported */
129 ECCurve_WTLS_9, /* not supported */
130 /* ECCurve_WTLS_10 == ECCurve_NIST_K233 */
131 /* ECCurve_WTLS_11 == ECCurve_NIST_B233 */
132 /* ECCurve_WTLS_12 == ECCurve_NIST_P224 */
133
134 ECCurve25519,
135
136 ECCurve_pastLastCurve
137} ECCurveName;
138
139/* Aliased named curves */
140
141#define ECCurve_X9_62_PRIME_192V1 ECCurve_NIST_P192 /* not supported */
142#define ECCurve_X9_62_PRIME_256V1 ECCurve_NIST_P256
143#define ECCurve_SECG_PRIME_192R1 ECCurve_NIST_P192 /* not supported */
144#define ECCurve_SECG_PRIME_224R1 ECCurve_NIST_P224 /* not supported */
145#define ECCurve_SECG_PRIME_256R1 ECCurve_NIST_P256
146#define ECCurve_SECG_PRIME_384R1 ECCurve_NIST_P384
147#define ECCurve_SECG_PRIME_521R1 ECCurve_NIST_P521
148#define ECCurve_SECG_CHAR2_163K1 ECCurve_NIST_K163 /* not supported */
149#define ECCurve_SECG_CHAR2_163R2 ECCurve_NIST_B163 /* not supported */
150#define ECCurve_SECG_CHAR2_233K1 ECCurve_NIST_K233 /* not supported */
151#define ECCurve_SECG_CHAR2_233R1 ECCurve_NIST_B233 /* not supported */
152#define ECCurve_SECG_CHAR2_283K1 ECCurve_NIST_K283 /* not supported */
153#define ECCurve_SECG_CHAR2_283R1 ECCurve_NIST_B283 /* not supported */
154#define ECCurve_SECG_CHAR2_409K1 ECCurve_NIST_K409 /* not supported */
155#define ECCurve_SECG_CHAR2_409R1 ECCurve_NIST_B409 /* not supported */
156#define ECCurve_SECG_CHAR2_571K1 ECCurve_NIST_K571 /* not supported */
157#define ECCurve_SECG_CHAR2_571R1 ECCurve_NIST_B571 /* not supported */
158#define ECCurve_WTLS_3 ECCurve_NIST_K163 /* not supported */
159#define ECCurve_WTLS_4 ECCurve_SECG_CHAR2_113R1 /* not supported */
160#define ECCurve_WTLS_5 ECCurve_X9_62_CHAR2_PNB163V1 /* not supported */
161#define ECCurve_WTLS_6 ECCurve_SECG_PRIME_112R1 /* not supported */
162#define ECCurve_WTLS_7 ECCurve_SECG_PRIME_160R1 /* not supported */
163#define ECCurve_WTLS_10 ECCurve_NIST_K233 /* not supported */
164#define ECCurve_WTLS_11 ECCurve_NIST_B233 /* not supported */
165#define ECCurve_WTLS_12 ECCurve_NIST_P224 /* not supported */
166
167#endif /* __ecl_exp_h_ */
168

source code of include/nss/ecl-exp.h