diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/ec/ec_lib.c | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c index 7cc69f8154..45df1329ff 100644 --- a/src/lib/libcrypto/ec/ec_lib.c +++ b/src/lib/libcrypto/ec/ec_lib.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ec_lib.c,v 1.41 2021/09/12 16:23:19 tb Exp $ */ | 1 | /* $OpenBSD: ec_lib.c,v 1.42 2022/03/29 13:44:06 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Originally written by Bodo Moeller for the OpenSSL project. | 3 | * Originally written by Bodo Moeller for the OpenSSL project. |
| 4 | */ | 4 | */ |
| @@ -114,7 +114,7 @@ EC_GROUP_new(const EC_METHOD * meth) | |||
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | 116 | ||
| 117 | void | 117 | void |
| 118 | EC_GROUP_free(EC_GROUP * group) | 118 | EC_GROUP_free(EC_GROUP * group) |
| 119 | { | 119 | { |
| 120 | if (!group) | 120 | if (!group) |
| @@ -135,7 +135,7 @@ EC_GROUP_free(EC_GROUP * group) | |||
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | 137 | ||
| 138 | void | 138 | void |
| 139 | EC_GROUP_clear_free(EC_GROUP * group) | 139 | EC_GROUP_clear_free(EC_GROUP * group) |
| 140 | { | 140 | { |
| 141 | if (!group) | 141 | if (!group) |
| @@ -157,7 +157,7 @@ EC_GROUP_clear_free(EC_GROUP * group) | |||
| 157 | } | 157 | } |
| 158 | 158 | ||
| 159 | 159 | ||
| 160 | int | 160 | int |
| 161 | EC_GROUP_copy(EC_GROUP * dest, const EC_GROUP * src) | 161 | EC_GROUP_copy(EC_GROUP * dest, const EC_GROUP * src) |
| 162 | { | 162 | { |
| 163 | EC_EXTRA_DATA *d; | 163 | EC_EXTRA_DATA *d; |
| @@ -247,7 +247,7 @@ EC_GROUP_method_of(const EC_GROUP *group) | |||
| 247 | } | 247 | } |
| 248 | 248 | ||
| 249 | 249 | ||
| 250 | int | 250 | int |
| 251 | EC_METHOD_get_field_type(const EC_METHOD *meth) | 251 | EC_METHOD_get_field_type(const EC_METHOD *meth) |
| 252 | { | 252 | { |
| 253 | return meth->field_type; | 253 | return meth->field_type; |
| @@ -300,7 +300,7 @@ ec_guess_cofactor(EC_GROUP *group) | |||
| 300 | if (!BN_copy(q, &group->field)) | 300 | if (!BN_copy(q, &group->field)) |
| 301 | goto err; | 301 | goto err; |
| 302 | } | 302 | } |
| 303 | 303 | ||
| 304 | /* | 304 | /* |
| 305 | * Compute | 305 | * Compute |
| 306 | * h = \lfloor (q + 1)/n \rceil = \lfloor (q + 1 + n/2) / n \rfloor. | 306 | * h = \lfloor (q + 1)/n \rceil = \lfloor (q + 1 + n/2) / n \rfloor. |
| @@ -328,7 +328,7 @@ ec_guess_cofactor(EC_GROUP *group) | |||
| 328 | return ret; | 328 | return ret; |
| 329 | } | 329 | } |
| 330 | 330 | ||
| 331 | int | 331 | int |
| 332 | EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, | 332 | EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, |
| 333 | const BIGNUM *order, const BIGNUM *cofactor) | 333 | const BIGNUM *order, const BIGNUM *cofactor) |
| 334 | { | 334 | { |
| @@ -392,7 +392,7 @@ EC_GROUP_get0_generator(const EC_GROUP *group) | |||
| 392 | } | 392 | } |
| 393 | 393 | ||
| 394 | 394 | ||
| 395 | int | 395 | int |
| 396 | EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx) | 396 | EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx) |
| 397 | { | 397 | { |
| 398 | if (!BN_copy(order, &group->order)) | 398 | if (!BN_copy(order, &group->order)) |
| @@ -407,7 +407,7 @@ EC_GROUP_order_bits(const EC_GROUP *group) | |||
| 407 | return group->meth->group_order_bits(group); | 407 | return group->meth->group_order_bits(group); |
| 408 | } | 408 | } |
| 409 | 409 | ||
| 410 | int | 410 | int |
| 411 | EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx) | 411 | EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx) |
| 412 | { | 412 | { |
| 413 | if (!BN_copy(cofactor, &group->cofactor)) | 413 | if (!BN_copy(cofactor, &group->cofactor)) |
| @@ -417,35 +417,35 @@ EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx) | |||
| 417 | } | 417 | } |
| 418 | 418 | ||
| 419 | 419 | ||
| 420 | void | 420 | void |
| 421 | EC_GROUP_set_curve_name(EC_GROUP * group, int nid) | 421 | EC_GROUP_set_curve_name(EC_GROUP * group, int nid) |
| 422 | { | 422 | { |
| 423 | group->curve_name = nid; | 423 | group->curve_name = nid; |
| 424 | } | 424 | } |
| 425 | 425 | ||
| 426 | 426 | ||
| 427 | int | 427 | int |
| 428 | EC_GROUP_get_curve_name(const EC_GROUP * group) | 428 | EC_GROUP_get_curve_name(const EC_GROUP * group) |
| 429 | { | 429 | { |
| 430 | return group->curve_name; | 430 | return group->curve_name; |
| 431 | } | 431 | } |
| 432 | 432 | ||
| 433 | 433 | ||
| 434 | void | 434 | void |
| 435 | EC_GROUP_set_asn1_flag(EC_GROUP * group, int flag) | 435 | EC_GROUP_set_asn1_flag(EC_GROUP * group, int flag) |
| 436 | { | 436 | { |
| 437 | group->asn1_flag = flag; | 437 | group->asn1_flag = flag; |
| 438 | } | 438 | } |
| 439 | 439 | ||
| 440 | 440 | ||
| 441 | int | 441 | int |
| 442 | EC_GROUP_get_asn1_flag(const EC_GROUP * group) | 442 | EC_GROUP_get_asn1_flag(const EC_GROUP * group) |
| 443 | { | 443 | { |
| 444 | return group->asn1_flag; | 444 | return group->asn1_flag; |
| 445 | } | 445 | } |
| 446 | 446 | ||
| 447 | 447 | ||
| 448 | void | 448 | void |
| 449 | EC_GROUP_set_point_conversion_form(EC_GROUP * group, | 449 | EC_GROUP_set_point_conversion_form(EC_GROUP * group, |
| 450 | point_conversion_form_t form) | 450 | point_conversion_form_t form) |
| 451 | { | 451 | { |
| @@ -453,14 +453,14 @@ EC_GROUP_set_point_conversion_form(EC_GROUP * group, | |||
| 453 | } | 453 | } |
| 454 | 454 | ||
| 455 | 455 | ||
| 456 | point_conversion_form_t | 456 | point_conversion_form_t |
| 457 | EC_GROUP_get_point_conversion_form(const EC_GROUP * group) | 457 | EC_GROUP_get_point_conversion_form(const EC_GROUP * group) |
| 458 | { | 458 | { |
| 459 | return group->asn1_form; | 459 | return group->asn1_form; |
| 460 | } | 460 | } |
| 461 | 461 | ||
| 462 | 462 | ||
| 463 | size_t | 463 | size_t |
| 464 | EC_GROUP_set_seed(EC_GROUP * group, const unsigned char *p, size_t len) | 464 | EC_GROUP_set_seed(EC_GROUP * group, const unsigned char *p, size_t len) |
| 465 | { | 465 | { |
| 466 | if (group->seed) { | 466 | if (group->seed) { |
| @@ -487,7 +487,7 @@ EC_GROUP_get0_seed(const EC_GROUP * group) | |||
| 487 | } | 487 | } |
| 488 | 488 | ||
| 489 | 489 | ||
| 490 | size_t | 490 | size_t |
| 491 | EC_GROUP_get_seed_len(const EC_GROUP * group) | 491 | EC_GROUP_get_seed_len(const EC_GROUP * group) |
| 492 | { | 492 | { |
| 493 | return group->seed_len; | 493 | return group->seed_len; |
| @@ -545,7 +545,7 @@ EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, | |||
| 545 | } | 545 | } |
| 546 | #endif | 546 | #endif |
| 547 | 547 | ||
| 548 | int | 548 | int |
| 549 | EC_GROUP_get_degree(const EC_GROUP * group) | 549 | EC_GROUP_get_degree(const EC_GROUP * group) |
| 550 | { | 550 | { |
| 551 | if (group->meth->group_get_degree == 0) { | 551 | if (group->meth->group_get_degree == 0) { |
| @@ -556,7 +556,7 @@ EC_GROUP_get_degree(const EC_GROUP * group) | |||
| 556 | } | 556 | } |
| 557 | 557 | ||
| 558 | 558 | ||
| 559 | int | 559 | int |
| 560 | EC_GROUP_check_discriminant(const EC_GROUP * group, BN_CTX * ctx) | 560 | EC_GROUP_check_discriminant(const EC_GROUP * group, BN_CTX * ctx) |
| 561 | { | 561 | { |
| 562 | if (group->meth->group_check_discriminant == 0) { | 562 | if (group->meth->group_check_discriminant == 0) { |
| @@ -567,7 +567,7 @@ EC_GROUP_check_discriminant(const EC_GROUP * group, BN_CTX * ctx) | |||
| 567 | } | 567 | } |
| 568 | 568 | ||
| 569 | 569 | ||
| 570 | int | 570 | int |
| 571 | EC_GROUP_cmp(const EC_GROUP * a, const EC_GROUP * b, BN_CTX * ctx) | 571 | EC_GROUP_cmp(const EC_GROUP * a, const EC_GROUP * b, BN_CTX * ctx) |
| 572 | { | 572 | { |
| 573 | int r = 0; | 573 | int r = 0; |
| @@ -660,7 +660,7 @@ ec_point_blind_coordinates(const EC_GROUP *group, EC_POINT *p, BN_CTX *ctx) | |||
| 660 | } | 660 | } |
| 661 | 661 | ||
| 662 | /* this has 'package' visibility */ | 662 | /* this has 'package' visibility */ |
| 663 | int | 663 | int |
| 664 | EC_EX_DATA_set_data(EC_EXTRA_DATA ** ex_data, void *data, | 664 | EC_EX_DATA_set_data(EC_EXTRA_DATA ** ex_data, void *data, |
| 665 | void *(*dup_func) (void *), | 665 | void *(*dup_func) (void *), |
| 666 | void (*free_func) (void *), | 666 | void (*free_func) (void *), |
| @@ -716,7 +716,7 @@ EC_EX_DATA_get_data(const EC_EXTRA_DATA * ex_data, | |||
| 716 | } | 716 | } |
| 717 | 717 | ||
| 718 | /* this has 'package' visibility */ | 718 | /* this has 'package' visibility */ |
| 719 | void | 719 | void |
| 720 | EC_EX_DATA_free_data(EC_EXTRA_DATA ** ex_data, | 720 | EC_EX_DATA_free_data(EC_EXTRA_DATA ** ex_data, |
| 721 | void *(*dup_func) (void *), | 721 | void *(*dup_func) (void *), |
| 722 | void (*free_func) (void *), | 722 | void (*free_func) (void *), |
| @@ -743,7 +743,7 @@ EC_EX_DATA_free_data(EC_EXTRA_DATA ** ex_data, | |||
| 743 | } | 743 | } |
| 744 | 744 | ||
| 745 | /* this has 'package' visibility */ | 745 | /* this has 'package' visibility */ |
| 746 | void | 746 | void |
| 747 | EC_EX_DATA_clear_free_data(EC_EXTRA_DATA ** ex_data, | 747 | EC_EX_DATA_clear_free_data(EC_EXTRA_DATA ** ex_data, |
| 748 | void *(*dup_func) (void *), | 748 | void *(*dup_func) (void *), |
| 749 | void (*free_func) (void *), | 749 | void (*free_func) (void *), |
| @@ -770,7 +770,7 @@ EC_EX_DATA_clear_free_data(EC_EXTRA_DATA ** ex_data, | |||
| 770 | } | 770 | } |
| 771 | 771 | ||
| 772 | /* this has 'package' visibility */ | 772 | /* this has 'package' visibility */ |
| 773 | void | 773 | void |
| 774 | EC_EX_DATA_free_all_data(EC_EXTRA_DATA ** ex_data) | 774 | EC_EX_DATA_free_all_data(EC_EXTRA_DATA ** ex_data) |
| 775 | { | 775 | { |
| 776 | EC_EXTRA_DATA *d; | 776 | EC_EXTRA_DATA *d; |
| @@ -791,7 +791,7 @@ EC_EX_DATA_free_all_data(EC_EXTRA_DATA ** ex_data) | |||
| 791 | } | 791 | } |
| 792 | 792 | ||
| 793 | /* this has 'package' visibility */ | 793 | /* this has 'package' visibility */ |
| 794 | void | 794 | void |
| 795 | EC_EX_DATA_clear_free_all_data(EC_EXTRA_DATA ** ex_data) | 795 | EC_EX_DATA_clear_free_all_data(EC_EXTRA_DATA ** ex_data) |
| 796 | { | 796 | { |
| 797 | EC_EXTRA_DATA *d; | 797 | EC_EXTRA_DATA *d; |
| @@ -842,7 +842,7 @@ EC_POINT_new(const EC_GROUP * group) | |||
| 842 | } | 842 | } |
| 843 | 843 | ||
| 844 | 844 | ||
| 845 | void | 845 | void |
| 846 | EC_POINT_free(EC_POINT * point) | 846 | EC_POINT_free(EC_POINT * point) |
| 847 | { | 847 | { |
| 848 | if (!point) | 848 | if (!point) |
| @@ -854,7 +854,7 @@ EC_POINT_free(EC_POINT * point) | |||
| 854 | } | 854 | } |
| 855 | 855 | ||
| 856 | 856 | ||
| 857 | void | 857 | void |
| 858 | EC_POINT_clear_free(EC_POINT * point) | 858 | EC_POINT_clear_free(EC_POINT * point) |
| 859 | { | 859 | { |
| 860 | if (!point) | 860 | if (!point) |
| @@ -868,7 +868,7 @@ EC_POINT_clear_free(EC_POINT * point) | |||
| 868 | } | 868 | } |
| 869 | 869 | ||
| 870 | 870 | ||
| 871 | int | 871 | int |
| 872 | EC_POINT_copy(EC_POINT * dest, const EC_POINT * src) | 872 | EC_POINT_copy(EC_POINT * dest, const EC_POINT * src) |
| 873 | { | 873 | { |
| 874 | if (dest->meth->point_copy == 0) { | 874 | if (dest->meth->point_copy == 0) { |
| @@ -913,7 +913,7 @@ EC_POINT_method_of(const EC_POINT * point) | |||
| 913 | } | 913 | } |
| 914 | 914 | ||
| 915 | 915 | ||
| 916 | int | 916 | int |
| 917 | EC_POINT_set_to_infinity(const EC_GROUP * group, EC_POINT * point) | 917 | EC_POINT_set_to_infinity(const EC_GROUP * group, EC_POINT * point) |
| 918 | { | 918 | { |
| 919 | if (group->meth->point_set_to_infinity == 0) { | 919 | if (group->meth->point_set_to_infinity == 0) { |
| @@ -1041,7 +1041,7 @@ EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, const EC_POINT *poin | |||
| 1041 | } | 1041 | } |
| 1042 | #endif | 1042 | #endif |
| 1043 | 1043 | ||
| 1044 | int | 1044 | int |
| 1045 | EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, | 1045 | EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, |
| 1046 | const EC_POINT *b, BN_CTX *ctx) | 1046 | const EC_POINT *b, BN_CTX *ctx) |
| 1047 | { | 1047 | { |
| @@ -1057,7 +1057,7 @@ EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, | |||
| 1057 | } | 1057 | } |
| 1058 | 1058 | ||
| 1059 | 1059 | ||
| 1060 | int | 1060 | int |
| 1061 | EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *ctx) | 1061 | EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *ctx) |
| 1062 | { | 1062 | { |
| 1063 | if (group->meth->dbl == 0) { | 1063 | if (group->meth->dbl == 0) { |
| @@ -1072,7 +1072,7 @@ EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *ctx) | |||
| 1072 | } | 1072 | } |
| 1073 | 1073 | ||
| 1074 | 1074 | ||
| 1075 | int | 1075 | int |
| 1076 | EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx) | 1076 | EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx) |
| 1077 | { | 1077 | { |
| 1078 | if (group->meth->invert == 0) { | 1078 | if (group->meth->invert == 0) { |
| @@ -1087,7 +1087,7 @@ EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx) | |||
| 1087 | } | 1087 | } |
| 1088 | 1088 | ||
| 1089 | 1089 | ||
| 1090 | int | 1090 | int |
| 1091 | EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) | 1091 | EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) |
| 1092 | { | 1092 | { |
| 1093 | if (group->meth->is_at_infinity == 0) { | 1093 | if (group->meth->is_at_infinity == 0) { |
| @@ -1102,7 +1102,7 @@ EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) | |||
| 1102 | } | 1102 | } |
| 1103 | 1103 | ||
| 1104 | 1104 | ||
| 1105 | int | 1105 | int |
| 1106 | EC_POINT_is_on_curve(const EC_GROUP * group, const EC_POINT * point, BN_CTX * ctx) | 1106 | EC_POINT_is_on_curve(const EC_GROUP * group, const EC_POINT * point, BN_CTX * ctx) |
| 1107 | { | 1107 | { |
| 1108 | if (group->meth->is_on_curve == 0) { | 1108 | if (group->meth->is_on_curve == 0) { |
| @@ -1117,7 +1117,7 @@ EC_POINT_is_on_curve(const EC_GROUP * group, const EC_POINT * point, BN_CTX * ct | |||
| 1117 | } | 1117 | } |
| 1118 | 1118 | ||
| 1119 | 1119 | ||
| 1120 | int | 1120 | int |
| 1121 | EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, | 1121 | EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, |
| 1122 | BN_CTX * ctx) | 1122 | BN_CTX * ctx) |
| 1123 | { | 1123 | { |
| @@ -1133,7 +1133,7 @@ EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, | |||
| 1133 | } | 1133 | } |
| 1134 | 1134 | ||
| 1135 | 1135 | ||
| 1136 | int | 1136 | int |
| 1137 | EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) | 1137 | EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) |
| 1138 | { | 1138 | { |
| 1139 | if (group->meth->make_affine == 0) { | 1139 | if (group->meth->make_affine == 0) { |
| @@ -1148,7 +1148,7 @@ EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) | |||
| 1148 | } | 1148 | } |
| 1149 | 1149 | ||
| 1150 | 1150 | ||
| 1151 | int | 1151 | int |
| 1152 | EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], | 1152 | EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], |
| 1153 | BN_CTX *ctx) | 1153 | BN_CTX *ctx) |
| 1154 | { | 1154 | { |
| @@ -1169,7 +1169,7 @@ EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], | |||
| 1169 | 1169 | ||
| 1170 | 1170 | ||
| 1171 | /* Functions for point multiplication */ | 1171 | /* Functions for point multiplication */ |
| 1172 | int | 1172 | int |
| 1173 | EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, | 1173 | EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, |
| 1174 | size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *ctx) | 1174 | size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *ctx) |
| 1175 | { | 1175 | { |
| @@ -1184,22 +1184,22 @@ EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, | |||
| 1184 | ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | 1184 | ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); |
| 1185 | return 0; | 1185 | return 0; |
| 1186 | } | 1186 | } |
| 1187 | 1187 | ||
| 1188 | /* Either bP or aG + bP, this is sane. */ | 1188 | /* Either bP or aG + bP, this is sane. */ |
| 1189 | if (num == 1 && points != NULL && scalars != NULL) | 1189 | if (num == 1 && points != NULL && scalars != NULL) |
| 1190 | return EC_POINT_mul(group, r, scalar, points[0], scalars[0], | 1190 | return EC_POINT_mul(group, r, scalar, points[0], scalars[0], |
| 1191 | ctx); | 1191 | ctx); |
| 1192 | 1192 | ||
| 1193 | /* aG, this is sane */ | 1193 | /* aG, this is sane */ |
| 1194 | if (scalar != NULL && points == NULL && scalars == NULL) | 1194 | if (scalar != NULL && points == NULL && scalars == NULL) |
| 1195 | return EC_POINT_mul(group, r, scalar, NULL, NULL, ctx); | 1195 | return EC_POINT_mul(group, r, scalar, NULL, NULL, ctx); |
| 1196 | 1196 | ||
| 1197 | /* anything else is an error */ | 1197 | /* anything else is an error */ |
| 1198 | ECerror(ERR_R_EC_LIB); | 1198 | ECerror(ERR_R_EC_LIB); |
| 1199 | return 0; | 1199 | return 0; |
| 1200 | } | 1200 | } |
| 1201 | 1201 | ||
| 1202 | int | 1202 | int |
| 1203 | EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, | 1203 | EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, |
| 1204 | const EC_POINT *point, const BIGNUM *p_scalar, BN_CTX *ctx) | 1204 | const EC_POINT *point, const BIGNUM *p_scalar, BN_CTX *ctx) |
| 1205 | { | 1205 | { |
| @@ -1241,13 +1241,13 @@ EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, | |||
| 1241 | return group->meth->mul_double_nonct(group, r, g_scalar, | 1241 | return group->meth->mul_double_nonct(group, r, g_scalar, |
| 1242 | p_scalar, point, ctx); | 1242 | p_scalar, point, ctx); |
| 1243 | } | 1243 | } |
| 1244 | 1244 | ||
| 1245 | /* Anything else is an error. */ | 1245 | /* Anything else is an error. */ |
| 1246 | ECerror(ERR_R_EC_LIB); | 1246 | ECerror(ERR_R_EC_LIB); |
| 1247 | return 0; | 1247 | return 0; |
| 1248 | } | 1248 | } |
| 1249 | 1249 | ||
| 1250 | int | 1250 | int |
| 1251 | EC_GROUP_precompute_mult(EC_GROUP * group, BN_CTX * ctx) | 1251 | EC_GROUP_precompute_mult(EC_GROUP * group, BN_CTX * ctx) |
| 1252 | { | 1252 | { |
| 1253 | if (group->meth->precompute_mult != 0) | 1253 | if (group->meth->precompute_mult != 0) |
| @@ -1256,7 +1256,7 @@ EC_GROUP_precompute_mult(EC_GROUP * group, BN_CTX * ctx) | |||
| 1256 | return 1; /* nothing to do, so report success */ | 1256 | return 1; /* nothing to do, so report success */ |
| 1257 | } | 1257 | } |
| 1258 | 1258 | ||
| 1259 | int | 1259 | int |
| 1260 | EC_GROUP_have_precompute_mult(const EC_GROUP * group) | 1260 | EC_GROUP_have_precompute_mult(const EC_GROUP * group) |
| 1261 | { | 1261 | { |
| 1262 | if (group->meth->have_precompute_mult != 0) | 1262 | if (group->meth->have_precompute_mult != 0) |
| @@ -1290,5 +1290,5 @@ ECParameters_dup(EC_KEY *key) | |||
| 1290 | if ((len = i2d_ECParameters(key, &p)) > 0) | 1290 | if ((len = i2d_ECParameters(key, &p)) > 0) |
| 1291 | k = d2i_ECParameters(NULL, (const unsigned char **)&p, len); | 1291 | k = d2i_ECParameters(NULL, (const unsigned char **)&p, len); |
| 1292 | 1292 | ||
| 1293 | return (k); | 1293 | return (k); |
| 1294 | } | 1294 | } |
