Eneboo - Documentación para desarrolladores
|
00001 /* crypto/ec/ec_lcl.h */ 00002 /* 00003 * Originally written by Bodo Moeller for the OpenSSL project. 00004 */ 00005 /* ==================================================================== 00006 * Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved. 00007 * 00008 * Redistribution and use in source and binary forms, with or without 00009 * modification, are permitted provided that the following conditions 00010 * are met: 00011 * 00012 * 1. Redistributions of source code must retain the above copyright 00013 * notice, this list of conditions and the following disclaimer. 00014 * 00015 * 2. Redistributions in binary form must reproduce the above copyright 00016 * notice, this list of conditions and the following disclaimer in 00017 * the documentation and/or other materials provided with the 00018 * distribution. 00019 * 00020 * 3. All advertising materials mentioning features or use of this 00021 * software must display the following acknowledgment: 00022 * "This product includes software developed by the OpenSSL Project 00023 * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 00024 * 00025 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 00026 * endorse or promote products derived from this software without 00027 * prior written permission. For written permission, please contact 00028 * openssl-core@openssl.org. 00029 * 00030 * 5. Products derived from this software may not be called "OpenSSL" 00031 * nor may "OpenSSL" appear in their names without prior written 00032 * permission of the OpenSSL Project. 00033 * 00034 * 6. Redistributions of any form whatsoever must retain the following 00035 * acknowledgment: 00036 * "This product includes software developed by the OpenSSL Project 00037 * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 00038 * 00039 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 00040 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00041 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00042 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 00043 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00044 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 00045 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00046 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00047 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 00048 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00049 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 00050 * OF THE POSSIBILITY OF SUCH DAMAGE. 00051 * ==================================================================== 00052 * 00053 * This product includes cryptographic software written by Eric Young 00054 * (eay@cryptsoft.com). This product includes software written by Tim 00055 * Hudson (tjh@cryptsoft.com). 00056 * 00057 */ 00058 /* ==================================================================== 00059 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 00060 * 00061 * Portions of the attached software ("Contribution") are developed by 00062 * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. 00063 * 00064 * The Contribution is licensed pursuant to the OpenSSL open source 00065 * license provided above. 00066 * 00067 * The elliptic curve binary polynomial software is originally written by 00068 * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories. 00069 * 00070 */ 00071 00072 00073 #include <stdlib.h> 00074 00075 #include <openssl/obj_mac.h> 00076 #include <openssl/ec.h> 00077 #include <openssl/bn.h> 00078 00079 #if defined(__SUNPRO_C) 00080 # if __SUNPRO_C >= 0x520 00081 # pragma error_messages (off,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE) 00082 # endif 00083 #endif 00084 00085 /* Structure details are not part of the exported interface, 00086 * so all this may change in future versions. */ 00087 00088 struct ec_method_st { 00089 /* used by EC_METHOD_get_field_type: */ 00090 int field_type; /* a NID */ 00091 00092 /* used by EC_GROUP_new, EC_GROUP_free, EC_GROUP_clear_free, EC_GROUP_copy: */ 00093 int (*group_init)(EC_GROUP *); 00094 void (*group_finish)(EC_GROUP *); 00095 void (*group_clear_finish)(EC_GROUP *); 00096 int (*group_copy)(EC_GROUP *, const EC_GROUP *); 00097 00098 /* used by EC_GROUP_set_curve_GFp, EC_GROUP_get_curve_GFp, */ 00099 /* EC_GROUP_set_curve_GF2m, and EC_GROUP_get_curve_GF2m: */ 00100 int (*group_set_curve)(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *); 00101 int (*group_get_curve)(const EC_GROUP *, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *); 00102 00103 /* used by EC_GROUP_get_degree: */ 00104 int (*group_get_degree)(const EC_GROUP *); 00105 00106 /* used by EC_GROUP_check: */ 00107 int (*group_check_discriminant)(const EC_GROUP *, BN_CTX *); 00108 00109 /* used by EC_POINT_new, EC_POINT_free, EC_POINT_clear_free, EC_POINT_copy: */ 00110 int (*point_init)(EC_POINT *); 00111 void (*point_finish)(EC_POINT *); 00112 void (*point_clear_finish)(EC_POINT *); 00113 int (*point_copy)(EC_POINT *, const EC_POINT *); 00114 00115 /* used by EC_POINT_set_to_infinity, 00116 * EC_POINT_set_Jprojective_coordinates_GFp, 00117 * EC_POINT_get_Jprojective_coordinates_GFp, 00118 * EC_POINT_set_affine_coordinates_GFp, ..._GF2m, 00119 * EC_POINT_get_affine_coordinates_GFp, ..._GF2m, 00120 * EC_POINT_set_compressed_coordinates_GFp, ..._GF2m: 00121 */ 00122 int (*point_set_to_infinity)(const EC_GROUP *, EC_POINT *); 00123 int (*point_set_Jprojective_coordinates_GFp)(const EC_GROUP *, EC_POINT *, 00124 const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *); 00125 int (*point_get_Jprojective_coordinates_GFp)(const EC_GROUP *, const EC_POINT *, 00126 BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *); 00127 int (*point_set_affine_coordinates)(const EC_GROUP *, EC_POINT *, 00128 const BIGNUM *x, const BIGNUM *y, BN_CTX *); 00129 int (*point_get_affine_coordinates)(const EC_GROUP *, const EC_POINT *, 00130 BIGNUM *x, BIGNUM *y, BN_CTX *); 00131 int (*point_set_compressed_coordinates)(const EC_GROUP *, EC_POINT *, 00132 const BIGNUM *x, int y_bit, BN_CTX *); 00133 00134 /* used by EC_POINT_point2oct, EC_POINT_oct2point: */ 00135 size_t (*point2oct)(const EC_GROUP *, const EC_POINT *, point_conversion_form_t form, 00136 unsigned char *buf, size_t len, BN_CTX *); 00137 int (*oct2point)(const EC_GROUP *, EC_POINT *, 00138 const unsigned char *buf, size_t len, BN_CTX *); 00139 00140 /* used by EC_POINT_add, EC_POINT_dbl, ECP_POINT_invert: */ 00141 int (*add)(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *); 00142 int (*dbl)(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, BN_CTX *); 00143 int (*invert)(const EC_GROUP *, EC_POINT *, BN_CTX *); 00144 00145 /* used by EC_POINT_is_at_infinity, EC_POINT_is_on_curve, EC_POINT_cmp: */ 00146 int (*is_at_infinity)(const EC_GROUP *, const EC_POINT *); 00147 int (*is_on_curve)(const EC_GROUP *, const EC_POINT *, BN_CTX *); 00148 int (*point_cmp)(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b, BN_CTX *); 00149 00150 /* used by EC_POINT_make_affine, EC_POINTs_make_affine: */ 00151 int (*make_affine)(const EC_GROUP *, EC_POINT *, BN_CTX *); 00152 int (*points_make_affine)(const EC_GROUP *, size_t num, EC_POINT *[], BN_CTX *); 00153 00154 /* used by EC_POINTs_mul, EC_POINT_mul, EC_POINT_precompute_mult, EC_POINT_have_precompute_mult 00155 * (default implementations are used if the 'mul' pointer is 0): */ 00156 int (*mul)(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 00157 size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *); 00158 int (*precompute_mult)(EC_GROUP *group, BN_CTX *); 00159 int (*have_precompute_mult)(const EC_GROUP *group); 00160 00161 00162 /* internal functions */ 00163 00164 /* 'field_mul', 'field_sqr', and 'field_div' can be used by 'add' and 'dbl' so that 00165 * the same implementations of point operations can be used with different 00166 * optimized implementations of expensive field operations: */ 00167 int (*field_mul)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *); 00168 int (*field_sqr)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *); 00169 int (*field_div)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *); 00170 00171 int (*field_encode)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *); /* e.g. to Montgomery */ 00172 int (*field_decode)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *); /* e.g. from Montgomery */ 00173 int (*field_set_to_one)(const EC_GROUP *, BIGNUM *r, BN_CTX *); 00174 } /* EC_METHOD */; 00175 00176 typedef struct ec_extra_data_st { 00177 struct ec_extra_data_st *next; 00178 void *data; 00179 void *(*dup_func)(void *); 00180 void (*free_func)(void *); 00181 void (*clear_free_func)(void *); 00182 } EC_EXTRA_DATA; /* used in EC_GROUP */ 00183 00184 struct ec_group_st { 00185 const EC_METHOD *meth; 00186 00187 EC_POINT *generator; /* optional */ 00188 BIGNUM order, cofactor; 00189 00190 int curve_name;/* optional NID for named curve */ 00191 int asn1_flag; /* flag to control the asn1 encoding */ 00192 point_conversion_form_t asn1_form; 00193 00194 unsigned char *seed; /* optional seed for parameters (appears in ASN1) */ 00195 size_t seed_len; 00196 00197 EC_EXTRA_DATA *extra_data; /* linked list */ 00198 00199 /* The following members are handled by the method functions, 00200 * even if they appear generic */ 00201 00202 BIGNUM field; /* Field specification. 00203 * For curves over GF(p), this is the modulus; 00204 * for curves over GF(2^m), this is the 00205 * irreducible polynomial defining the field. 00206 */ 00207 00208 unsigned int poly[5]; /* Field specification for curves over GF(2^m). 00209 * The irreducible f(t) is then of the form: 00210 * t^poly[0] + t^poly[1] + ... + t^poly[k] 00211 * where m = poly[0] > poly[1] > ... > poly[k] = 0. 00212 */ 00213 00214 BIGNUM a, b; /* Curve coefficients. 00215 * (Here the assumption is that BIGNUMs can be used 00216 * or abused for all kinds of fields, not just GF(p).) 00217 * For characteristic > 3, the curve is defined 00218 * by a Weierstrass equation of the form 00219 * y^2 = x^3 + a*x + b. 00220 * For characteristic 2, the curve is defined by 00221 * an equation of the form 00222 * y^2 + x*y = x^3 + a*x^2 + b. 00223 */ 00224 00225 int a_is_minus3; /* enable optimized point arithmetics for special case */ 00226 00227 void *field_data1; /* method-specific (e.g., Montgomery structure) */ 00228 void *field_data2; /* method-specific */ 00229 int (*field_mod_func)(BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *); /* method-specific */ 00230 } /* EC_GROUP */; 00231 00232 struct ec_key_st { 00233 int version; 00234 00235 EC_GROUP *group; 00236 00237 EC_POINT *pub_key; 00238 BIGNUM *priv_key; 00239 00240 unsigned int enc_flag; 00241 point_conversion_form_t conv_form; 00242 00243 int references; 00244 00245 EC_EXTRA_DATA *method_data; 00246 } /* EC_KEY */; 00247 00248 /* Basically a 'mixin' for extra data, but available for EC_GROUPs/EC_KEYs only 00249 * (with visibility limited to 'package' level for now). 00250 * We use the function pointers as index for retrieval; this obviates 00251 * global ex_data-style index tables. 00252 */ 00253 int EC_EX_DATA_set_data(EC_EXTRA_DATA **, void *data, 00254 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *)); 00255 void *EC_EX_DATA_get_data(const EC_EXTRA_DATA *, 00256 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *)); 00257 void EC_EX_DATA_free_data(EC_EXTRA_DATA **, 00258 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *)); 00259 void EC_EX_DATA_clear_free_data(EC_EXTRA_DATA **, 00260 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *)); 00261 void EC_EX_DATA_free_all_data(EC_EXTRA_DATA **); 00262 void EC_EX_DATA_clear_free_all_data(EC_EXTRA_DATA **); 00263 00264 00265 00266 struct ec_point_st { 00267 const EC_METHOD *meth; 00268 00269 /* All members except 'meth' are handled by the method functions, 00270 * even if they appear generic */ 00271 00272 BIGNUM X; 00273 BIGNUM Y; 00274 BIGNUM Z; /* Jacobian projective coordinates: 00275 * (X, Y, Z) represents (X/Z^2, Y/Z^3) if Z != 0 */ 00276 int Z_is_one; /* enable optimized point arithmetics for special case */ 00277 } /* EC_POINT */; 00278 00279 00280 00281 /* method functions in ec_mult.c 00282 * (ec_lib.c uses these as defaults if group->method->mul is 0) */ 00283 int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 00284 size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *); 00285 int ec_wNAF_precompute_mult(EC_GROUP *group, BN_CTX *); 00286 int ec_wNAF_have_precompute_mult(const EC_GROUP *group); 00287 00288 00289 /* method functions in ecp_smpl.c */ 00290 int ec_GFp_simple_group_init(EC_GROUP *); 00291 void ec_GFp_simple_group_finish(EC_GROUP *); 00292 void ec_GFp_simple_group_clear_finish(EC_GROUP *); 00293 int ec_GFp_simple_group_copy(EC_GROUP *, const EC_GROUP *); 00294 int ec_GFp_simple_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *); 00295 int ec_GFp_simple_group_get_curve(const EC_GROUP *, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *); 00296 int ec_GFp_simple_group_get_degree(const EC_GROUP *); 00297 int ec_GFp_simple_group_check_discriminant(const EC_GROUP *, BN_CTX *); 00298 int ec_GFp_simple_point_init(EC_POINT *); 00299 void ec_GFp_simple_point_finish(EC_POINT *); 00300 void ec_GFp_simple_point_clear_finish(EC_POINT *); 00301 int ec_GFp_simple_point_copy(EC_POINT *, const EC_POINT *); 00302 int ec_GFp_simple_point_set_to_infinity(const EC_GROUP *, EC_POINT *); 00303 int ec_GFp_simple_set_Jprojective_coordinates_GFp(const EC_GROUP *, EC_POINT *, 00304 const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *); 00305 int ec_GFp_simple_get_Jprojective_coordinates_GFp(const EC_GROUP *, const EC_POINT *, 00306 BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *); 00307 int ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP *, EC_POINT *, 00308 const BIGNUM *x, const BIGNUM *y, BN_CTX *); 00309 int ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP *, const EC_POINT *, 00310 BIGNUM *x, BIGNUM *y, BN_CTX *); 00311 int ec_GFp_simple_set_compressed_coordinates(const EC_GROUP *, EC_POINT *, 00312 const BIGNUM *x, int y_bit, BN_CTX *); 00313 size_t ec_GFp_simple_point2oct(const EC_GROUP *, const EC_POINT *, point_conversion_form_t form, 00314 unsigned char *buf, size_t len, BN_CTX *); 00315 int ec_GFp_simple_oct2point(const EC_GROUP *, EC_POINT *, 00316 const unsigned char *buf, size_t len, BN_CTX *); 00317 int ec_GFp_simple_add(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *); 00318 int ec_GFp_simple_dbl(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, BN_CTX *); 00319 int ec_GFp_simple_invert(const EC_GROUP *, EC_POINT *, BN_CTX *); 00320 int ec_GFp_simple_is_at_infinity(const EC_GROUP *, const EC_POINT *); 00321 int ec_GFp_simple_is_on_curve(const EC_GROUP *, const EC_POINT *, BN_CTX *); 00322 int ec_GFp_simple_cmp(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b, BN_CTX *); 00323 int ec_GFp_simple_make_affine(const EC_GROUP *, EC_POINT *, BN_CTX *); 00324 int ec_GFp_simple_points_make_affine(const EC_GROUP *, size_t num, EC_POINT *[], BN_CTX *); 00325 int ec_GFp_simple_field_mul(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *); 00326 int ec_GFp_simple_field_sqr(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *); 00327 00328 00329 /* method functions in ecp_mont.c */ 00330 int ec_GFp_mont_group_init(EC_GROUP *); 00331 int ec_GFp_mont_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *); 00332 void ec_GFp_mont_group_finish(EC_GROUP *); 00333 void ec_GFp_mont_group_clear_finish(EC_GROUP *); 00334 int ec_GFp_mont_group_copy(EC_GROUP *, const EC_GROUP *); 00335 int ec_GFp_mont_field_mul(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *); 00336 int ec_GFp_mont_field_sqr(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *); 00337 int ec_GFp_mont_field_encode(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *); 00338 int ec_GFp_mont_field_decode(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *); 00339 int ec_GFp_mont_field_set_to_one(const EC_GROUP *, BIGNUM *r, BN_CTX *); 00340 00341 00342 /* method functions in ecp_nist.c */ 00343 int ec_GFp_nist_group_copy(EC_GROUP *dest, const EC_GROUP *src); 00344 int ec_GFp_nist_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *); 00345 int ec_GFp_nist_field_mul(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *); 00346 int ec_GFp_nist_field_sqr(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *); 00347 00348 00349 /* method functions in ec2_smpl.c */ 00350 int ec_GF2m_simple_group_init(EC_GROUP *); 00351 void ec_GF2m_simple_group_finish(EC_GROUP *); 00352 void ec_GF2m_simple_group_clear_finish(EC_GROUP *); 00353 int ec_GF2m_simple_group_copy(EC_GROUP *, const EC_GROUP *); 00354 int ec_GF2m_simple_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *); 00355 int ec_GF2m_simple_group_get_curve(const EC_GROUP *, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *); 00356 int ec_GF2m_simple_group_get_degree(const EC_GROUP *); 00357 int ec_GF2m_simple_group_check_discriminant(const EC_GROUP *, BN_CTX *); 00358 int ec_GF2m_simple_point_init(EC_POINT *); 00359 void ec_GF2m_simple_point_finish(EC_POINT *); 00360 void ec_GF2m_simple_point_clear_finish(EC_POINT *); 00361 int ec_GF2m_simple_point_copy(EC_POINT *, const EC_POINT *); 00362 int ec_GF2m_simple_point_set_to_infinity(const EC_GROUP *, EC_POINT *); 00363 int ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP *, EC_POINT *, 00364 const BIGNUM *x, const BIGNUM *y, BN_CTX *); 00365 int ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *, const EC_POINT *, 00366 BIGNUM *x, BIGNUM *y, BN_CTX *); 00367 int ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *, EC_POINT *, 00368 const BIGNUM *x, int y_bit, BN_CTX *); 00369 size_t ec_GF2m_simple_point2oct(const EC_GROUP *, const EC_POINT *, point_conversion_form_t form, 00370 unsigned char *buf, size_t len, BN_CTX *); 00371 int ec_GF2m_simple_oct2point(const EC_GROUP *, EC_POINT *, 00372 const unsigned char *buf, size_t len, BN_CTX *); 00373 int ec_GF2m_simple_add(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *); 00374 int ec_GF2m_simple_dbl(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, BN_CTX *); 00375 int ec_GF2m_simple_invert(const EC_GROUP *, EC_POINT *, BN_CTX *); 00376 int ec_GF2m_simple_is_at_infinity(const EC_GROUP *, const EC_POINT *); 00377 int ec_GF2m_simple_is_on_curve(const EC_GROUP *, const EC_POINT *, BN_CTX *); 00378 int ec_GF2m_simple_cmp(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b, BN_CTX *); 00379 int ec_GF2m_simple_make_affine(const EC_GROUP *, EC_POINT *, BN_CTX *); 00380 int ec_GF2m_simple_points_make_affine(const EC_GROUP *, size_t num, EC_POINT *[], BN_CTX *); 00381 int ec_GF2m_simple_field_mul(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *); 00382 int ec_GF2m_simple_field_sqr(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *); 00383 int ec_GF2m_simple_field_div(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *); 00384 00385 00386 /* method functions in ec2_mult.c */ 00387 int ec_GF2m_simple_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 00388 size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *); 00389 int ec_GF2m_precompute_mult(EC_GROUP *group, BN_CTX *ctx); 00390 int ec_GF2m_have_precompute_mult(const EC_GROUP *group);