diff options
Diffstat (limited to 'src/lib/libcrypto/ec/ec_lcl.h')
-rw-r--r-- | src/lib/libcrypto/ec/ec_lcl.h | 55 |
1 files changed, 54 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ec/ec_lcl.h b/src/lib/libcrypto/ec/ec_lcl.h index 3e2c34b0bc..da7967df38 100644 --- a/src/lib/libcrypto/ec/ec_lcl.h +++ b/src/lib/libcrypto/ec/ec_lcl.h | |||
@@ -3,7 +3,7 @@ | |||
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-2010 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 |
@@ -82,10 +82,15 @@ | |||
82 | # endif | 82 | # endif |
83 | #endif | 83 | #endif |
84 | 84 | ||
85 | /* Use default functions for poin2oct, oct2point and compressed coordinates */ | ||
86 | #define EC_FLAGS_DEFAULT_OCT 0x1 | ||
87 | |||
85 | /* Structure details are not part of the exported interface, | 88 | /* Structure details are not part of the exported interface, |
86 | * so all this may change in future versions. */ | 89 | * so all this may change in future versions. */ |
87 | 90 | ||
88 | struct ec_method_st { | 91 | struct ec_method_st { |
92 | /* Various method flags */ | ||
93 | int flags; | ||
89 | /* used by EC_METHOD_get_field_type: */ | 94 | /* used by EC_METHOD_get_field_type: */ |
90 | int field_type; /* a NID */ | 95 | int field_type; /* a NID */ |
91 | 96 | ||
@@ -244,6 +249,7 @@ struct ec_key_st { | |||
244 | point_conversion_form_t conv_form; | 249 | point_conversion_form_t conv_form; |
245 | 250 | ||
246 | int references; | 251 | int references; |
252 | int flags; | ||
247 | 253 | ||
248 | EC_EXTRA_DATA *method_data; | 254 | EC_EXTRA_DATA *method_data; |
249 | } /* EC_KEY */; | 255 | } /* EC_KEY */; |
@@ -391,3 +397,50 @@ int ec_GF2m_simple_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, | |||
391 | size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *); | 397 | size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *); |
392 | int ec_GF2m_precompute_mult(EC_GROUP *group, BN_CTX *ctx); | 398 | int ec_GF2m_precompute_mult(EC_GROUP *group, BN_CTX *ctx); |
393 | int ec_GF2m_have_precompute_mult(const EC_GROUP *group); | 399 | int ec_GF2m_have_precompute_mult(const EC_GROUP *group); |
400 | |||
401 | /* method functions in ec2_mult.c */ | ||
402 | int ec_GF2m_simple_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, | ||
403 | size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *); | ||
404 | int ec_GF2m_precompute_mult(EC_GROUP *group, BN_CTX *ctx); | ||
405 | int ec_GF2m_have_precompute_mult(const EC_GROUP *group); | ||
406 | |||
407 | #ifndef OPENSSL_EC_NISTP_64_GCC_128 | ||
408 | /* method functions in ecp_nistp224.c */ | ||
409 | int ec_GFp_nistp224_group_init(EC_GROUP *group); | ||
410 | int ec_GFp_nistp224_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *n, BN_CTX *); | ||
411 | int ec_GFp_nistp224_point_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *point, BIGNUM *x, BIGNUM *y, BN_CTX *ctx); | ||
412 | int ec_GFp_nistp224_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *); | ||
413 | int ec_GFp_nistp224_points_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *ctx); | ||
414 | int ec_GFp_nistp224_precompute_mult(EC_GROUP *group, BN_CTX *ctx); | ||
415 | int ec_GFp_nistp224_have_precompute_mult(const EC_GROUP *group); | ||
416 | |||
417 | /* method functions in ecp_nistp256.c */ | ||
418 | int ec_GFp_nistp256_group_init(EC_GROUP *group); | ||
419 | int ec_GFp_nistp256_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *n, BN_CTX *); | ||
420 | int ec_GFp_nistp256_point_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *point, BIGNUM *x, BIGNUM *y, BN_CTX *ctx); | ||
421 | int ec_GFp_nistp256_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *); | ||
422 | int ec_GFp_nistp256_points_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *ctx); | ||
423 | int ec_GFp_nistp256_precompute_mult(EC_GROUP *group, BN_CTX *ctx); | ||
424 | int ec_GFp_nistp256_have_precompute_mult(const EC_GROUP *group); | ||
425 | |||
426 | /* method functions in ecp_nistp521.c */ | ||
427 | int ec_GFp_nistp521_group_init(EC_GROUP *group); | ||
428 | int ec_GFp_nistp521_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *n, BN_CTX *); | ||
429 | int ec_GFp_nistp521_point_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *point, BIGNUM *x, BIGNUM *y, BN_CTX *ctx); | ||
430 | int ec_GFp_nistp521_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *); | ||
431 | int ec_GFp_nistp521_points_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *ctx); | ||
432 | int ec_GFp_nistp521_precompute_mult(EC_GROUP *group, BN_CTX *ctx); | ||
433 | int ec_GFp_nistp521_have_precompute_mult(const EC_GROUP *group); | ||
434 | |||
435 | /* utility functions in ecp_nistputil.c */ | ||
436 | void ec_GFp_nistp_points_make_affine_internal(size_t num, void *point_array, | ||
437 | size_t felem_size, void *tmp_felems, | ||
438 | void (*felem_one)(void *out), | ||
439 | int (*felem_is_zero)(const void *in), | ||
440 | void (*felem_assign)(void *out, const void *in), | ||
441 | void (*felem_square)(void *out, const void *in), | ||
442 | void (*felem_mul)(void *out, const void *in1, const void *in2), | ||
443 | void (*felem_inv)(void *out, const void *in), | ||
444 | void (*felem_contract)(void *out, const void *in)); | ||
445 | void ec_GFp_nistp_recode_scalar_bits(unsigned char *sign, unsigned char *digit, unsigned char in); | ||
446 | #endif | ||