OLD | NEW |
1 /* crypto/ec/ec_lcl.h */ | 1 /* crypto/ec/ec_lcl.h */ |
2 /* | 2 /* |
3 * Originally written by Bodo Moeller for the OpenSSL project. | 3 * Originally written by Bodo Moeller for the OpenSSL project. |
4 */ | 4 */ |
5 /* ==================================================================== | 5 /* ==================================================================== |
6 * Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved. | 6 * Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 198 |
199 /* The following members are handled by the method functions, | 199 /* The following members are handled by the method functions, |
200 * even if they appear generic */ | 200 * even if they appear generic */ |
201 | 201 |
202 BIGNUM field; /* Field specification. | 202 BIGNUM field; /* Field specification. |
203 * For curves over GF(p), this is the modulus; | 203 * For curves over GF(p), this is the modulus; |
204 * for curves over GF(2^m), this is the | 204 * for curves over GF(2^m), this is the |
205 * irreducible polynomial defining the field. | 205 * irreducible polynomial defining the field. |
206 */ | 206 */ |
207 | 207 |
208 » unsigned int poly[5]; /* Field specification for curves over GF(2^m). | 208 » int poly[6]; /* Field specification for curves over GF(2^m). |
209 » * The irreducible f(t) is then of the form: | 209 » * The irreducible f(t) is then of the form: |
210 » * t^poly[0] + t^poly[1] + ... + t^poly[k] | 210 » * t^poly[0] + t^poly[1] + ... + t^poly[k] |
211 » * where m = poly[0] > poly[1] > ... > poly[k] = 0
. | 211 » * where m = poly[0] > poly[1] > ... > poly[k] = 0. |
212 » */ | 212 » * The array is terminated with poly[k+1]=-1. |
| 213 » * All elliptic curve irreducibles have at most 5 |
| 214 » * non-zero terms. |
| 215 » */ |
213 | 216 |
214 BIGNUM a, b; /* Curve coefficients. | 217 BIGNUM a, b; /* Curve coefficients. |
215 * (Here the assumption is that BIGNUMs can be used | 218 * (Here the assumption is that BIGNUMs can be used |
216 * or abused for all kinds of fields, not just GF(p).) | 219 * or abused for all kinds of fields, not just GF(p).) |
217 * For characteristic > 3, the curve is defined | 220 * For characteristic > 3, the curve is defined |
218 * by a Weierstrass equation of the form | 221 * by a Weierstrass equation of the form |
219 * y^2 = x^3 + a*x + b. | 222 * y^2 = x^3 + a*x + b. |
220 * For characteristic 2, the curve is defined by | 223 * For characteristic 2, the curve is defined by |
221 * an equation of the form | 224 * an equation of the form |
222 * y^2 + x*y = x^3 + a*x^2 + b. | 225 * y^2 + x*y = x^3 + a*x^2 + b. |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 int ec_GF2m_simple_field_mul(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, const
BIGNUM *b, BN_CTX *); | 384 int ec_GF2m_simple_field_mul(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, const
BIGNUM *b, BN_CTX *); |
382 int ec_GF2m_simple_field_sqr(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CT
X *); | 385 int ec_GF2m_simple_field_sqr(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CT
X *); |
383 int ec_GF2m_simple_field_div(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, const
BIGNUM *b, BN_CTX *); | 386 int ec_GF2m_simple_field_div(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, const
BIGNUM *b, BN_CTX *); |
384 | 387 |
385 | 388 |
386 /* method functions in ec2_mult.c */ | 389 /* method functions in ec2_mult.c */ |
387 int ec_GF2m_simple_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, | 390 int ec_GF2m_simple_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, |
388 size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *)
; | 391 size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *)
; |
389 int ec_GF2m_precompute_mult(EC_GROUP *group, BN_CTX *ctx); | 392 int ec_GF2m_precompute_mult(EC_GROUP *group, BN_CTX *ctx); |
390 int ec_GF2m_have_precompute_mult(const EC_GROUP *group); | 393 int ec_GF2m_have_precompute_mult(const EC_GROUP *group); |
OLD | NEW |