]> git.ipfire.org Git - thirdparty/openssl.git/blob - crypto/ec/ec.h
Run util/openssl-format-source -v -c .
[thirdparty/openssl.git] / crypto / ec / ec.h
1 /* crypto/ec/ec.h */
2 /*
3 * Originally written by Bodo Moeller for the OpenSSL project.
4 */
5 /* ====================================================================
6 * Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * openssl-core@openssl.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58 /* ====================================================================
59 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
60 *
61 * Portions of the attached software ("Contribution") are developed by
62 * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
63 *
64 * The Contribution is licensed pursuant to the OpenSSL open source
65 * license provided above.
66 *
67 * The elliptic curve binary polynomial software is originally written by
68 * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories.
69 *
70 */
71
72 #ifndef HEADER_EC_H
73 # define HEADER_EC_H
74
75 # include <openssl/opensslconf.h>
76
77 # ifdef OPENSSL_NO_EC
78 # error EC is disabled.
79 # endif
80
81 # include <openssl/asn1.h>
82 # include <openssl/symhacks.h>
83 # ifndef OPENSSL_NO_DEPRECATED
84 # include <openssl/bn.h>
85 # endif
86
87 # ifdef __cplusplus
88 extern "C" {
89 # elif defined(__SUNPRO_C)
90 # if __SUNPRO_C >= 0x520
91 # pragma error_messages (off,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE)
92 # endif
93 # endif
94
95 # ifndef OPENSSL_ECC_MAX_FIELD_BITS
96 # define OPENSSL_ECC_MAX_FIELD_BITS 661
97 # endif
98
99 typedef enum {
100 /* values as defined in X9.62 (ECDSA) and elsewhere */
101 POINT_CONVERSION_COMPRESSED = 2,
102 POINT_CONVERSION_UNCOMPRESSED = 4,
103 POINT_CONVERSION_HYBRID = 6
104 } point_conversion_form_t;
105
106 typedef struct ec_method_st EC_METHOD;
107
108 typedef struct ec_group_st
109 /*-
110 EC_METHOD *meth;
111 -- field definition
112 -- curve coefficients
113 -- optional generator with associated information (order, cofactor)
114 -- optional extra data (precomputed table for fast computation of multiples of generator)
115 -- ASN1 stuff
116 */
117 EC_GROUP;
118
119 typedef struct ec_point_st EC_POINT;
120
121 /*
122 * EC_METHODs for curves over GF(p). EC_GFp_simple_method provides the basis
123 * for the optimized methods.
124 */
125 const EC_METHOD *EC_GFp_simple_method(void);
126 const EC_METHOD *EC_GFp_mont_method(void);
127 const EC_METHOD *EC_GFp_nist_method(void);
128
129 /*
130 * EC_METHOD for curves over GF(2^m).
131 */
132 const EC_METHOD *EC_GF2m_simple_method(void);
133
134 EC_GROUP *EC_GROUP_new(const EC_METHOD *);
135 void EC_GROUP_free(EC_GROUP *);
136 void EC_GROUP_clear_free(EC_GROUP *);
137 int EC_GROUP_copy(EC_GROUP *, const EC_GROUP *);
138 EC_GROUP *EC_GROUP_dup(const EC_GROUP *);
139
140 const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *);
141 int EC_METHOD_get_field_type(const EC_METHOD *);
142
143 int EC_GROUP_set_generator(EC_GROUP *, const EC_POINT *generator,
144 const BIGNUM *order, const BIGNUM *cofactor);
145 const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *);
146 int EC_GROUP_get_order(const EC_GROUP *, BIGNUM *order, BN_CTX *);
147 int EC_GROUP_get_cofactor(const EC_GROUP *, BIGNUM *cofactor, BN_CTX *);
148
149 void EC_GROUP_set_curve_name(EC_GROUP *, int nid);
150 int EC_GROUP_get_curve_name(const EC_GROUP *);
151
152 void EC_GROUP_set_asn1_flag(EC_GROUP *, int flag);
153 int EC_GROUP_get_asn1_flag(const EC_GROUP *);
154
155 void EC_GROUP_set_point_conversion_form(EC_GROUP *, point_conversion_form_t);
156 point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *);
157
158 unsigned char *EC_GROUP_get0_seed(const EC_GROUP *);
159 size_t EC_GROUP_get_seed_len(const EC_GROUP *);
160 size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len);
161
162 int EC_GROUP_set_curve_GFp(EC_GROUP *, const BIGNUM *p, const BIGNUM *a,
163 const BIGNUM *b, BN_CTX *);
164 int EC_GROUP_get_curve_GFp(const EC_GROUP *, BIGNUM *p, BIGNUM *a, BIGNUM *b,
165 BN_CTX *);
166 int EC_GROUP_set_curve_GF2m(EC_GROUP *, const BIGNUM *p, const BIGNUM *a,
167 const BIGNUM *b, BN_CTX *);
168 int EC_GROUP_get_curve_GF2m(const EC_GROUP *, BIGNUM *p, BIGNUM *a, BIGNUM *b,
169 BN_CTX *);
170
171 /* returns the number of bits needed to represent a field element */
172 int EC_GROUP_get_degree(const EC_GROUP *);
173
174 /* EC_GROUP_check() returns 1 if 'group' defines a valid group, 0 otherwise */
175 int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx);
176 /*
177 * EC_GROUP_check_discriminant() returns 1 if the discriminant of the
178 * elliptic curve is not zero, 0 otherwise
179 */
180 int EC_GROUP_check_discriminant(const EC_GROUP *, BN_CTX *);
181
182 /* EC_GROUP_cmp() returns 0 if both groups are equal and 1 otherwise */
183 int EC_GROUP_cmp(const EC_GROUP *, const EC_GROUP *, BN_CTX *);
184
185 /*
186 * EC_GROUP_new_GF*() calls EC_GROUP_new() and EC_GROUP_set_GF*() after
187 * choosing an appropriate EC_METHOD
188 */
189 EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a,
190 const BIGNUM *b, BN_CTX *);
191 EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a,
192 const BIGNUM *b, BN_CTX *);
193
194 /*
195 * EC_GROUP_new_by_curve_name() creates a EC_GROUP structure specified by a
196 * curve name (in form of a NID)
197 */
198 EC_GROUP *EC_GROUP_new_by_curve_name(int nid);
199 /* handling of internal curves */
200 typedef struct {
201 int nid;
202 const char *comment;
203 } EC_builtin_curve;
204 /*
205 * EC_builtin_curves(EC_builtin_curve *r, size_t size) returns number of all
206 * available curves or zero if a error occurred. In case r ist not zero
207 * nitems EC_builtin_curve structures are filled with the data of the first
208 * nitems internal groups
209 */
210 size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems);
211
212 /* EC_POINT functions */
213
214 EC_POINT *EC_POINT_new(const EC_GROUP *);
215 void EC_POINT_free(EC_POINT *);
216 void EC_POINT_clear_free(EC_POINT *);
217 int EC_POINT_copy(EC_POINT *, const EC_POINT *);
218 EC_POINT *EC_POINT_dup(const EC_POINT *, const EC_GROUP *);
219
220 const EC_METHOD *EC_POINT_method_of(const EC_POINT *);
221
222 int EC_POINT_set_to_infinity(const EC_GROUP *, EC_POINT *);
223 int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *, EC_POINT *,
224 const BIGNUM *x, const BIGNUM *y,
225 const BIGNUM *z, BN_CTX *);
226 int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *,
227 const EC_POINT *, BIGNUM *x,
228 BIGNUM *y, BIGNUM *z, BN_CTX *);
229 int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *, EC_POINT *,
230 const BIGNUM *x, const BIGNUM *y,
231 BN_CTX *);
232 int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *, const EC_POINT *,
233 BIGNUM *x, BIGNUM *y, BN_CTX *);
234 int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *, EC_POINT *,
235 const BIGNUM *x, int y_bit,
236 BN_CTX *);
237
238 int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *, EC_POINT *,
239 const BIGNUM *x, const BIGNUM *y,
240 BN_CTX *);
241 int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *, const EC_POINT *,
242 BIGNUM *x, BIGNUM *y, BN_CTX *);
243 int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *, EC_POINT *,
244 const BIGNUM *x, int y_bit,
245 BN_CTX *);
246
247 size_t EC_POINT_point2oct(const EC_GROUP *, const EC_POINT *,
248 point_conversion_form_t form, unsigned char *buf,
249 size_t len, BN_CTX *);
250 int EC_POINT_oct2point(const EC_GROUP *, EC_POINT *, const unsigned char *buf,
251 size_t len, BN_CTX *);
252
253 /* other interfaces to point2oct/oct2point: */
254 BIGNUM *EC_POINT_point2bn(const EC_GROUP *, const EC_POINT *,
255 point_conversion_form_t form, BIGNUM *, BN_CTX *);
256 EC_POINT *EC_POINT_bn2point(const EC_GROUP *, const BIGNUM *,
257 EC_POINT *, BN_CTX *);
258 char *EC_POINT_point2hex(const EC_GROUP *, const EC_POINT *,
259 point_conversion_form_t form, BN_CTX *);
260 EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *,
261 EC_POINT *, BN_CTX *);
262
263 int EC_POINT_add(const EC_GROUP *, EC_POINT *r, const EC_POINT *a,
264 const EC_POINT *b, BN_CTX *);
265 int EC_POINT_dbl(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, BN_CTX *);
266 int EC_POINT_invert(const EC_GROUP *, EC_POINT *, BN_CTX *);
267
268 int EC_POINT_is_at_infinity(const EC_GROUP *, const EC_POINT *);
269 int EC_POINT_is_on_curve(const EC_GROUP *, const EC_POINT *, BN_CTX *);
270 int EC_POINT_cmp(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b,
271 BN_CTX *);
272
273 int EC_POINT_make_affine(const EC_GROUP *, EC_POINT *, BN_CTX *);
274 int EC_POINTs_make_affine(const EC_GROUP *, size_t num, EC_POINT *[],
275 BN_CTX *);
276
277 int EC_POINTs_mul(const EC_GROUP *, EC_POINT *r, const BIGNUM *, size_t num,
278 const EC_POINT *[], const BIGNUM *[], BN_CTX *);
279 int EC_POINT_mul(const EC_GROUP *, EC_POINT *r, const BIGNUM *,
280 const EC_POINT *, const BIGNUM *, BN_CTX *);
281
282 /*
283 * EC_GROUP_precompute_mult() stores multiples of generator for faster point
284 * multiplication
285 */
286 int EC_GROUP_precompute_mult(EC_GROUP *, BN_CTX *);
287 /*
288 * EC_GROUP_have_precompute_mult() reports whether such precomputation has
289 * been done
290 */
291 int EC_GROUP_have_precompute_mult(const EC_GROUP *);
292
293 /* ASN1 stuff */
294
295 /*
296 * EC_GROUP_get_basis_type() returns the NID of the basis type used to
297 * represent the field elements
298 */
299 int EC_GROUP_get_basis_type(const EC_GROUP *);
300 int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k);
301 int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,
302 unsigned int *k2, unsigned int *k3);
303
304 # define OPENSSL_EC_NAMED_CURVE 0x001
305
306 typedef struct ecpk_parameters_st ECPKPARAMETERS;
307
308 EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len);
309 int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out);
310
311 # define d2i_ECPKParameters_bio(bp,x) ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x)
312 # define i2d_ECPKParameters_bio(bp,x) ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x)
313 # define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL, \
314 (char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x))
315 # define i2d_ECPKParameters_fp(fp,x) ASN1_i2d_fp(i2d_ECPKParameters,(fp), \
316 (unsigned char *)(x))
317
318 # ifndef OPENSSL_NO_BIO
319 int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off);
320 # endif
321 # ifndef OPENSSL_NO_FP_API
322 int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off);
323 # endif
324
325 /* the EC_KEY stuff */
326 typedef struct ec_key_st EC_KEY;
327
328 /* some values for the encoding_flag */
329 # define EC_PKEY_NO_PARAMETERS 0x001
330 # define EC_PKEY_NO_PUBKEY 0x002
331
332 EC_KEY *EC_KEY_new(void);
333 EC_KEY *EC_KEY_new_by_curve_name(int nid);
334 void EC_KEY_free(EC_KEY *);
335 EC_KEY *EC_KEY_copy(EC_KEY *, const EC_KEY *);
336 EC_KEY *EC_KEY_dup(const EC_KEY *);
337
338 int EC_KEY_up_ref(EC_KEY *);
339
340 const EC_GROUP *EC_KEY_get0_group(const EC_KEY *);
341 int EC_KEY_set_group(EC_KEY *, const EC_GROUP *);
342 const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *);
343 int EC_KEY_set_private_key(EC_KEY *, const BIGNUM *);
344 const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *);
345 int EC_KEY_set_public_key(EC_KEY *, const EC_POINT *);
346 unsigned EC_KEY_get_enc_flags(const EC_KEY *);
347 void EC_KEY_set_enc_flags(EC_KEY *, unsigned int);
348 point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *);
349 void EC_KEY_set_conv_form(EC_KEY *, point_conversion_form_t);
350 /* functions to set/get method specific data */
351 void *EC_KEY_get_key_method_data(EC_KEY *,
352 void *(*dup_func) (void *),
353 void (*free_func) (void *),
354 void (*clear_free_func) (void *));
355 /** Sets the key method data of an EC_KEY object, if none has yet been set.
356 * \param key EC_KEY object
357 * \param data opaque data to install.
358 * \param dup_func a function that duplicates |data|.
359 * \param free_func a function that frees |data|.
360 * \param clear_free_func a function that wipes and frees |data|.
361 * \return the previously set data pointer, or NULL if |data| was inserted.
362 */
363 void *EC_KEY_insert_key_method_data(EC_KEY *key, void *data,
364 void *(*dup_func) (void *),
365 void (*free_func) (void *),
366 void (*clear_free_func) (void *));
367 /* wrapper functions for the underlying EC_GROUP object */
368 void EC_KEY_set_asn1_flag(EC_KEY *, int);
369 int EC_KEY_precompute_mult(EC_KEY *, BN_CTX *ctx);
370
371 /* EC_KEY_generate_key() creates a ec private (public) key */
372 int EC_KEY_generate_key(EC_KEY *);
373 /* EC_KEY_check_key() */
374 int EC_KEY_check_key(const EC_KEY *);
375
376 /* de- and encoding functions for SEC1 ECPrivateKey */
377 EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len);
378 int i2d_ECPrivateKey(EC_KEY *a, unsigned char **out);
379 /* de- and encoding functions for EC parameters */
380 EC_KEY *d2i_ECParameters(EC_KEY **a, const unsigned char **in, long len);
381 int i2d_ECParameters(EC_KEY *a, unsigned char **out);
382 /*
383 * de- and encoding functions for EC public key (octet string, not DER --
384 * hence 'o2i' and 'i2o')
385 */
386 EC_KEY *o2i_ECPublicKey(EC_KEY **a, const unsigned char **in, long len);
387 int i2o_ECPublicKey(EC_KEY *a, unsigned char **out);
388
389 # ifndef OPENSSL_NO_BIO
390 int ECParameters_print(BIO *bp, const EC_KEY *x);
391 int EC_KEY_print(BIO *bp, const EC_KEY *x, int off);
392 # endif
393 # ifndef OPENSSL_NO_FP_API
394 int ECParameters_print_fp(FILE *fp, const EC_KEY *x);
395 int EC_KEY_print_fp(FILE *fp, const EC_KEY *x, int off);
396 # endif
397
398 # define ECParameters_dup(x) ASN1_dup_of(EC_KEY,i2d_ECParameters,d2i_ECParameters,x)
399
400 # ifndef __cplusplus
401 # if defined(__SUNPRO_C)
402 # if __SUNPRO_C >= 0x520
403 # pragma error_messages (default,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE)
404 # endif
405 # endif
406 # endif
407
408 /* BEGIN ERROR CODES */
409 /*
410 * The following lines are auto generated by the script mkerr.pl. Any changes
411 * made after this point may be overwritten when the script is next run.
412 */
413 void ERR_load_EC_strings(void);
414
415 /* Error codes for the EC functions. */
416
417 /* Function codes. */
418 # define EC_F_COMPUTE_WNAF 143
419 # define EC_F_D2I_ECPARAMETERS 144
420 # define EC_F_D2I_ECPKPARAMETERS 145
421 # define EC_F_D2I_ECPRIVATEKEY 146
422 # define EC_F_ECPARAMETERS_PRINT 147
423 # define EC_F_ECPARAMETERS_PRINT_FP 148
424 # define EC_F_ECPKPARAMETERS_PRINT 149
425 # define EC_F_ECPKPARAMETERS_PRINT_FP 150
426 # define EC_F_ECP_NIST_MOD_192 203
427 # define EC_F_ECP_NIST_MOD_224 204
428 # define EC_F_ECP_NIST_MOD_256 205
429 # define EC_F_ECP_NIST_MOD_521 206
430 # define EC_F_EC_ASN1_GROUP2CURVE 153
431 # define EC_F_EC_ASN1_GROUP2FIELDID 154
432 # define EC_F_EC_ASN1_GROUP2PARAMETERS 155
433 # define EC_F_EC_ASN1_GROUP2PKPARAMETERS 156
434 # define EC_F_EC_ASN1_PARAMETERS2GROUP 157
435 # define EC_F_EC_ASN1_PKPARAMETERS2GROUP 158
436 # define EC_F_EC_EX_DATA_SET_DATA 211
437 # define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY 208
438 # define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 159
439 # define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE 195
440 # define EC_F_EC_GF2M_SIMPLE_OCT2POINT 160
441 # define EC_F_EC_GF2M_SIMPLE_POINT2OCT 161
442 # define EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES 162
443 # define EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES 163
444 # define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 164
445 # define EC_F_EC_GFP_MONT_FIELD_DECODE 133
446 # define EC_F_EC_GFP_MONT_FIELD_ENCODE 134
447 # define EC_F_EC_GFP_MONT_FIELD_MUL 131
448 # define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE 209
449 # define EC_F_EC_GFP_MONT_FIELD_SQR 132
450 # define EC_F_EC_GFP_MONT_GROUP_SET_CURVE 189
451 # define EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP 135
452 # define EC_F_EC_GFP_NIST_FIELD_MUL 200
453 # define EC_F_EC_GFP_NIST_FIELD_SQR 201
454 # define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202
455 # define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 165
456 # define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 166
457 # define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP 100
458 # define EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR 101
459 # define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 102
460 # define EC_F_EC_GFP_SIMPLE_OCT2POINT 103
461 # define EC_F_EC_GFP_SIMPLE_POINT2OCT 104
462 # define EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE 137
463 # define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES 167
464 # define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP 105
465 # define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES 168
466 # define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP 128
467 # define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES 169
468 # define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP 129
469 # define EC_F_EC_GROUP_CHECK 170
470 # define EC_F_EC_GROUP_CHECK_DISCRIMINANT 171
471 # define EC_F_EC_GROUP_COPY 106
472 # define EC_F_EC_GROUP_GET0_GENERATOR 139
473 # define EC_F_EC_GROUP_GET_COFACTOR 140
474 # define EC_F_EC_GROUP_GET_CURVE_GF2M 172
475 # define EC_F_EC_GROUP_GET_CURVE_GFP 130
476 # define EC_F_EC_GROUP_GET_DEGREE 173
477 # define EC_F_EC_GROUP_GET_ORDER 141
478 # define EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS 193
479 # define EC_F_EC_GROUP_GET_TRINOMIAL_BASIS 194
480 # define EC_F_EC_GROUP_NEW 108
481 # define EC_F_EC_GROUP_NEW_BY_CURVE_NAME 174
482 # define EC_F_EC_GROUP_NEW_FROM_DATA 175
483 # define EC_F_EC_GROUP_PRECOMPUTE_MULT 142
484 # define EC_F_EC_GROUP_SET_CURVE_GF2M 176
485 # define EC_F_EC_GROUP_SET_CURVE_GFP 109
486 # define EC_F_EC_GROUP_SET_EXTRA_DATA 110
487 # define EC_F_EC_GROUP_SET_GENERATOR 111
488 # define EC_F_EC_KEY_CHECK_KEY 177
489 # define EC_F_EC_KEY_COPY 178
490 # define EC_F_EC_KEY_GENERATE_KEY 179
491 # define EC_F_EC_KEY_NEW 182
492 # define EC_F_EC_KEY_PRINT 180
493 # define EC_F_EC_KEY_PRINT_FP 181
494 # define EC_F_EC_POINTS_MAKE_AFFINE 136
495 # define EC_F_EC_POINTS_MUL 138
496 # define EC_F_EC_POINT_ADD 112
497 # define EC_F_EC_POINT_CMP 113
498 # define EC_F_EC_POINT_COPY 114
499 # define EC_F_EC_POINT_DBL 115
500 # define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M 183
501 # define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP 116
502 # define EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP 117
503 # define EC_F_EC_POINT_INVERT 210
504 # define EC_F_EC_POINT_IS_AT_INFINITY 118
505 # define EC_F_EC_POINT_IS_ON_CURVE 119
506 # define EC_F_EC_POINT_MAKE_AFFINE 120
507 # define EC_F_EC_POINT_MUL 184
508 # define EC_F_EC_POINT_NEW 121
509 # define EC_F_EC_POINT_OCT2POINT 122
510 # define EC_F_EC_POINT_POINT2OCT 123
511 # define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M 185
512 # define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP 124
513 # define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M 186
514 # define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP 125
515 # define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP 126
516 # define EC_F_EC_POINT_SET_TO_INFINITY 127
517 # define EC_F_EC_PRE_COMP_DUP 207
518 # define EC_F_EC_PRE_COMP_NEW 196
519 # define EC_F_EC_WNAF_MUL 187
520 # define EC_F_EC_WNAF_PRECOMPUTE_MULT 188
521 # define EC_F_I2D_ECPARAMETERS 190
522 # define EC_F_I2D_ECPKPARAMETERS 191
523 # define EC_F_I2D_ECPRIVATEKEY 192
524 # define EC_F_I2O_ECPUBLICKEY 151
525 # define EC_F_O2I_ECPUBLICKEY 152
526
527 /* Reason codes. */
528 # define EC_R_ASN1_ERROR 115
529 # define EC_R_ASN1_UNKNOWN_FIELD 116
530 # define EC_R_BUFFER_TOO_SMALL 100
531 # define EC_R_D2I_ECPKPARAMETERS_FAILURE 117
532 # define EC_R_DISCRIMINANT_IS_ZERO 118
533 # define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 119
534 # define EC_R_FIELD_TOO_LARGE 138
535 # define EC_R_GROUP2PKPARAMETERS_FAILURE 120
536 # define EC_R_I2D_ECPKPARAMETERS_FAILURE 121
537 # define EC_R_INCOMPATIBLE_OBJECTS 101
538 # define EC_R_INVALID_ARGUMENT 112
539 # define EC_R_INVALID_COMPRESSED_POINT 110
540 # define EC_R_INVALID_COMPRESSION_BIT 109
541 # define EC_R_INVALID_ENCODING 102
542 # define EC_R_INVALID_FIELD 103
543 # define EC_R_INVALID_FORM 104
544 # define EC_R_INVALID_GROUP_ORDER 122
545 # define EC_R_INVALID_PENTANOMIAL_BASIS 132
546 # define EC_R_INVALID_PRIVATE_KEY 123
547 # define EC_R_INVALID_TRINOMIAL_BASIS 137
548 # define EC_R_MISSING_PARAMETERS 124
549 # define EC_R_MISSING_PRIVATE_KEY 125
550 # define EC_R_NOT_A_NIST_PRIME 135
551 # define EC_R_NOT_A_SUPPORTED_NIST_PRIME 136
552 # define EC_R_NOT_IMPLEMENTED 126
553 # define EC_R_NOT_INITIALIZED 111
554 # define EC_R_NO_FIELD_MOD 133
555 # define EC_R_PASSED_NULL_PARAMETER 134
556 # define EC_R_PKPARAMETERS2GROUP_FAILURE 127
557 # define EC_R_POINT_AT_INFINITY 106
558 # define EC_R_POINT_IS_NOT_ON_CURVE 107
559 # define EC_R_SLOT_FULL 108
560 # define EC_R_UNDEFINED_GENERATOR 113
561 # define EC_R_UNDEFINED_ORDER 128
562 # define EC_R_UNKNOWN_GROUP 129
563 # define EC_R_UNKNOWN_ORDER 114
564 # define EC_R_UNSUPPORTED_FIELD 131
565 # define EC_R_WRONG_ORDER 130
566
567 #ifdef __cplusplus
568 }
569 #endif
570 #endif