~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/security/nss/lib/freebl/ecl/ecl-exp.h

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
3
 *
 
4
 * The contents of this file are subject to the Mozilla Public License Version
 
5
 * 1.1 (the "License"); you may not use this file except in compliance with
 
6
 * the License. You may obtain a copy of the License at
 
7
 * http://www.mozilla.org/MPL/
 
8
 *
 
9
 * Software distributed under the License is distributed on an "AS IS" basis,
 
10
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
11
 * for the specific language governing rights and limitations under the
 
12
 * License.
 
13
 *
 
14
 * The Original Code is the elliptic curve math library.
 
15
 *
 
16
 * The Initial Developer of the Original Code is Sun Microsystems, Inc.
 
17
 * Portions created by Sun Microsystems, Inc. are Copyright (C) 2003
 
18
 * Sun Microsystems, Inc. All Rights Reserved.
 
19
 *
 
20
 * Contributor(s):
 
21
 *      Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories
 
22
 *
 
23
 * Alternatively, the contents of this file may be used under the terms of
 
24
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 
25
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
26
 * in which case the provisions of the GPL or the LGPL are applicable instead
 
27
 * of those above. If you wish to allow use of your version of this file only
 
28
 * under the terms of either the GPL or the LGPL, and not to allow others to
 
29
 * use your version of this file under the terms of the MPL, indicate your
 
30
 * decision by deleting the provisions above and replace them with the notice
 
31
 * and other provisions required by the GPL or the LGPL. If you do not delete
 
32
 * the provisions above, a recipient may use your version of this file under
 
33
 * the terms of any one of the MPL, the GPL or the LGPL.
 
34
 *
 
35
 */
 
36
 
 
37
#ifndef __ecl_exp_h_
 
38
#define __ecl_exp_h_
 
39
 
 
40
/* Curve field type */
 
41
typedef enum {
 
42
        ECField_GFp,
 
43
        ECField_GF2m
 
44
} ECField;
 
45
 
 
46
/* Hexadecimal encoding of curve parameters */
 
47
struct ECCurveParamsStr {
 
48
        char *text;
 
49
        ECField field;
 
50
        unsigned int size;
 
51
        char *irr;
 
52
        char *curvea;
 
53
        char *curveb;
 
54
        char *genx;
 
55
        char *geny;
 
56
        char *order;
 
57
        int cofactor;
 
58
};
 
59
typedef struct ECCurveParamsStr ECCurveParams;
 
60
 
 
61
/* Named curve parameters */
 
62
typedef enum {
 
63
 
 
64
        ECCurve_noName = 0,
 
65
 
 
66
        /* NIST prime curves */
 
67
        ECCurve_NIST_P192,
 
68
        ECCurve_NIST_P224,
 
69
        ECCurve_NIST_P256,
 
70
        ECCurve_NIST_P384,
 
71
        ECCurve_NIST_P521,
 
72
 
 
73
        /* NIST binary curves */
 
74
        ECCurve_NIST_K163,
 
75
        ECCurve_NIST_B163,
 
76
        ECCurve_NIST_K233,
 
77
        ECCurve_NIST_B233,
 
78
        ECCurve_NIST_K283,
 
79
        ECCurve_NIST_B283,
 
80
        ECCurve_NIST_K409,
 
81
        ECCurve_NIST_B409,
 
82
        ECCurve_NIST_K571,
 
83
        ECCurve_NIST_B571,
 
84
 
 
85
        /* ANSI X9.62 prime curves */
 
86
        /* ECCurve_X9_62_PRIME_192V1 == ECCurve_NIST_P192 */
 
87
        ECCurve_X9_62_PRIME_192V2,
 
88
        ECCurve_X9_62_PRIME_192V3,
 
89
        ECCurve_X9_62_PRIME_239V1,
 
90
        ECCurve_X9_62_PRIME_239V2,
 
91
        ECCurve_X9_62_PRIME_239V3,
 
92
        /* ECCurve_X9_62_PRIME_256V1 == ECCurve_NIST_P256 */
 
93
 
 
94
        /* ANSI X9.62 binary curves */
 
95
        ECCurve_X9_62_CHAR2_PNB163V1,
 
96
        ECCurve_X9_62_CHAR2_PNB163V2,
 
97
        ECCurve_X9_62_CHAR2_PNB163V3,
 
98
        ECCurve_X9_62_CHAR2_PNB176V1,
 
99
        ECCurve_X9_62_CHAR2_TNB191V1,
 
100
        ECCurve_X9_62_CHAR2_TNB191V2,
 
101
        ECCurve_X9_62_CHAR2_TNB191V3,
 
102
        ECCurve_X9_62_CHAR2_PNB208W1,
 
103
        ECCurve_X9_62_CHAR2_TNB239V1,
 
104
        ECCurve_X9_62_CHAR2_TNB239V2,
 
105
        ECCurve_X9_62_CHAR2_TNB239V3,
 
106
        ECCurve_X9_62_CHAR2_PNB272W1,
 
107
        ECCurve_X9_62_CHAR2_PNB304W1,
 
108
        ECCurve_X9_62_CHAR2_TNB359V1,
 
109
        ECCurve_X9_62_CHAR2_PNB368W1,
 
110
        ECCurve_X9_62_CHAR2_TNB431R1,
 
111
 
 
112
        /* SEC2 prime curves */
 
113
        ECCurve_SECG_PRIME_112R1,
 
114
        ECCurve_SECG_PRIME_112R2,
 
115
        ECCurve_SECG_PRIME_128R1,
 
116
        ECCurve_SECG_PRIME_128R2,
 
117
        ECCurve_SECG_PRIME_160K1,
 
118
        ECCurve_SECG_PRIME_160R1,
 
119
        ECCurve_SECG_PRIME_160R2,
 
120
        ECCurve_SECG_PRIME_192K1,
 
121
        /* ECCurve_SECG_PRIME_192R1 == ECCurve_NIST_P192 */
 
122
        ECCurve_SECG_PRIME_224K1,
 
123
        /* ECCurve_SECG_PRIME_224R1 == ECCurve_NIST_P224 */
 
124
        ECCurve_SECG_PRIME_256K1,
 
125
        /* ECCurve_SECG_PRIME_256R1 == ECCurve_NIST_P256 */
 
126
        /* ECCurve_SECG_PRIME_384R1 == ECCurve_NIST_P384 */
 
127
        /* ECCurve_SECG_PRIME_521R1 == ECCurve_NIST_P521 */
 
128
 
 
129
        /* SEC2 binary curves */
 
130
        ECCurve_SECG_CHAR2_113R1,
 
131
        ECCurve_SECG_CHAR2_113R2,
 
132
        ECCurve_SECG_CHAR2_131R1,
 
133
        ECCurve_SECG_CHAR2_131R2,
 
134
        /* ECCurve_SECG_CHAR2_163K1 == ECCurve_NIST_K163 */
 
135
        ECCurve_SECG_CHAR2_163R1,
 
136
        /* ECCurve_SECG_CHAR2_163R2 == ECCurve_NIST_B163 */
 
137
        ECCurve_SECG_CHAR2_193R1,
 
138
        ECCurve_SECG_CHAR2_193R2,
 
139
        /* ECCurve_SECG_CHAR2_233K1 == ECCurve_NIST_K233 */
 
140
        /* ECCurve_SECG_CHAR2_233R1 == ECCurve_NIST_B233 */
 
141
        ECCurve_SECG_CHAR2_239K1,
 
142
        /* ECCurve_SECG_CHAR2_283K1 == ECCurve_NIST_K283 */
 
143
        /* ECCurve_SECG_CHAR2_283R1 == ECCurve_NIST_B283 */
 
144
        /* ECCurve_SECG_CHAR2_409K1 == ECCurve_NIST_K409 */
 
145
        /* ECCurve_SECG_CHAR2_409R1 == ECCurve_NIST_B409 */
 
146
        /* ECCurve_SECG_CHAR2_571K1 == ECCurve_NIST_K571 */
 
147
        /* ECCurve_SECG_CHAR2_571R1 == ECCurve_NIST_B571 */
 
148
 
 
149
        /* WTLS curves */
 
150
        ECCurve_WTLS_1,
 
151
        /* there is no WTLS 2 curve */
 
152
        /* ECCurve_WTLS_3 == ECCurve_NIST_K163 */
 
153
        /* ECCurve_WTLS_4 == ECCurve_SECG_CHAR2_113R1 */
 
154
        /* ECCurve_WTLS_5 == ECCurve_X9_62_CHAR2_PNB163V1 */
 
155
        /* ECCurve_WTLS_6 == ECCurve_SECG_PRIME_112R1 */
 
156
        /* ECCurve_WTLS_7 == ECCurve_SECG_PRIME_160R1 */
 
157
        ECCurve_WTLS_8,
 
158
        ECCurve_WTLS_9,
 
159
        /* ECCurve_WTLS_10 == ECCurve_NIST_K233 */
 
160
        /* ECCurve_WTLS_11 == ECCurve_NIST_B233 */
 
161
        /* ECCurve_WTLS_12 == ECCurve_NIST_P224 */
 
162
 
 
163
        ECCurve_pastLastCurve
 
164
} ECCurveName;
 
165
 
 
166
/* Aliased named curves */
 
167
 
 
168
#define ECCurve_X9_62_PRIME_192V1 ECCurve_NIST_P192
 
169
#define ECCurve_X9_62_PRIME_256V1 ECCurve_NIST_P256
 
170
#define ECCurve_SECG_PRIME_192R1 ECCurve_NIST_P192
 
171
#define ECCurve_SECG_PRIME_224R1 ECCurve_NIST_P224
 
172
#define ECCurve_SECG_PRIME_256R1 ECCurve_NIST_P256
 
173
#define ECCurve_SECG_PRIME_384R1 ECCurve_NIST_P384
 
174
#define ECCurve_SECG_PRIME_521R1 ECCurve_NIST_P521
 
175
#define ECCurve_SECG_CHAR2_163K1 ECCurve_NIST_K163
 
176
#define ECCurve_SECG_CHAR2_163R2 ECCurve_NIST_B163
 
177
#define ECCurve_SECG_CHAR2_233K1 ECCurve_NIST_K233
 
178
#define ECCurve_SECG_CHAR2_233R1 ECCurve_NIST_B233
 
179
#define ECCurve_SECG_CHAR2_283K1 ECCurve_NIST_K283
 
180
#define ECCurve_SECG_CHAR2_283R1 ECCurve_NIST_B283
 
181
#define ECCurve_SECG_CHAR2_409K1 ECCurve_NIST_K409
 
182
#define ECCurve_SECG_CHAR2_409R1 ECCurve_NIST_B409
 
183
#define ECCurve_SECG_CHAR2_571K1 ECCurve_NIST_K571
 
184
#define ECCurve_SECG_CHAR2_571R1 ECCurve_NIST_B571
 
185
#define ECCurve_WTLS_3 ECCurve_NIST_K163
 
186
#define ECCurve_WTLS_4 ECCurve_SECG_CHAR2_113R1
 
187
#define ECCurve_WTLS_5 ECCurve_X9_62_CHAR2_PNB163V1
 
188
#define ECCurve_WTLS_6 ECCurve_SECG_PRIME_112R1
 
189
#define ECCurve_WTLS_7 ECCurve_SECG_PRIME_160R1
 
190
#define ECCurve_WTLS_10 ECCurve_NIST_K233
 
191
#define ECCurve_WTLS_11 ECCurve_NIST_B233
 
192
#define ECCurve_WTLS_12 ECCurve_NIST_P224
 
193
 
 
194
#endif                                                  /* __ecl_exp_h_ */