diff options
| author | tb <> | 2021-04-20 17:28:18 +0000 |
|---|---|---|
| committer | tb <> | 2021-04-20 17:28:18 +0000 |
| commit | 4c5b30b47dcb1bfe14ac8c29c7cf559fb5844541 (patch) | |
| tree | 84821870dcd67fd9178210e1adcc84248265dab1 /src/lib/libcrypto/ec/ecp_smpl.c | |
| parent | 51b396b145b6146bbdaac4d315068130e31179df (diff) | |
| download | openbsd-4c5b30b47dcb1bfe14ac8c29c7cf559fb5844541.tar.gz openbsd-4c5b30b47dcb1bfe14ac8c29c7cf559fb5844541.tar.bz2 openbsd-4c5b30b47dcb1bfe14ac8c29c7cf559fb5844541.zip | |
Provide EC_POINT_{g,s}et_Jprojective_coordinates for internal use
ok jsing
Diffstat (limited to 'src/lib/libcrypto/ec/ecp_smpl.c')
| -rw-r--r-- | src/lib/libcrypto/ec/ecp_smpl.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/lib/libcrypto/ec/ecp_smpl.c b/src/lib/libcrypto/ec/ecp_smpl.c index e1fd9007c7..9223427459 100644 --- a/src/lib/libcrypto/ec/ecp_smpl.c +++ b/src/lib/libcrypto/ec/ecp_smpl.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ecp_smpl.c,v 1.30 2021/04/20 17:16:38 tb Exp $ */ | 1 | /* $OpenBSD: ecp_smpl.c,v 1.31 2021/04/20 17:28:18 tb Exp $ */ |
| 2 | /* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> | 2 | /* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> |
| 3 | * for the OpenSSL project. | 3 | * for the OpenSSL project. |
| 4 | * Includes code written by Bodo Moeller for the OpenSSL project. | 4 | * Includes code written by Bodo Moeller for the OpenSSL project. |
| @@ -87,10 +87,10 @@ EC_GFp_simple_method(void) | |||
| 87 | .point_clear_finish = ec_GFp_simple_point_clear_finish, | 87 | .point_clear_finish = ec_GFp_simple_point_clear_finish, |
| 88 | .point_copy = ec_GFp_simple_point_copy, | 88 | .point_copy = ec_GFp_simple_point_copy, |
| 89 | .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity, | 89 | .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity, |
| 90 | .point_set_Jprojective_coordinates_GFp = | 90 | .point_set_Jprojective_coordinates = |
| 91 | ec_GFp_simple_set_Jprojective_coordinates_GFp, | 91 | ec_GFp_simple_set_Jprojective_coordinates, |
| 92 | .point_get_Jprojective_coordinates_GFp = | 92 | .point_get_Jprojective_coordinates = |
| 93 | ec_GFp_simple_get_Jprojective_coordinates_GFp, | 93 | ec_GFp_simple_get_Jprojective_coordinates, |
| 94 | .point_set_affine_coordinates = | 94 | .point_set_affine_coordinates = |
| 95 | ec_GFp_simple_point_set_affine_coordinates, | 95 | ec_GFp_simple_point_set_affine_coordinates, |
| 96 | .point_get_affine_coordinates = | 96 | .point_get_affine_coordinates = |
| @@ -413,9 +413,10 @@ ec_GFp_simple_point_set_to_infinity(const EC_GROUP * group, EC_POINT * point) | |||
| 413 | } | 413 | } |
| 414 | 414 | ||
| 415 | 415 | ||
| 416 | int | 416 | int |
| 417 | ec_GFp_simple_set_Jprojective_coordinates_GFp(const EC_GROUP * group, EC_POINT * point, | 417 | ec_GFp_simple_set_Jprojective_coordinates(const EC_GROUP *group, |
| 418 | const BIGNUM * x, const BIGNUM * y, const BIGNUM * z, BN_CTX * ctx) | 418 | EC_POINT *point, const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, |
| 419 | BN_CTX *ctx) | ||
| 419 | { | 420 | { |
| 420 | BN_CTX *new_ctx = NULL; | 421 | BN_CTX *new_ctx = NULL; |
| 421 | int ret = 0; | 422 | int ret = 0; |
| @@ -465,10 +466,9 @@ ec_GFp_simple_set_Jprojective_coordinates_GFp(const EC_GROUP * group, EC_POINT * | |||
| 465 | return ret; | 466 | return ret; |
| 466 | } | 467 | } |
| 467 | 468 | ||
| 468 | 469 | int | |
| 469 | int | 470 | ec_GFp_simple_get_Jprojective_coordinates(const EC_GROUP *group, |
| 470 | ec_GFp_simple_get_Jprojective_coordinates_GFp(const EC_GROUP * group, const EC_POINT * point, | 471 | const EC_POINT *point, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx) |
| 471 | BIGNUM * x, BIGNUM * y, BIGNUM * z, BN_CTX * ctx) | ||
| 472 | { | 472 | { |
| 473 | BN_CTX *new_ctx = NULL; | 473 | BN_CTX *new_ctx = NULL; |
| 474 | int ret = 0; | 474 | int ret = 0; |
| @@ -513,8 +513,7 @@ ec_GFp_simple_get_Jprojective_coordinates_GFp(const EC_GROUP * group, const EC_P | |||
| 513 | return ret; | 513 | return ret; |
| 514 | } | 514 | } |
| 515 | 515 | ||
| 516 | 516 | int | |
| 517 | int | ||
| 518 | ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP * group, EC_POINT * point, | 517 | ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP * group, EC_POINT * point, |
| 519 | const BIGNUM * x, const BIGNUM * y, BN_CTX * ctx) | 518 | const BIGNUM * x, const BIGNUM * y, BN_CTX * ctx) |
| 520 | { | 519 | { |
| @@ -523,11 +522,11 @@ ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP * group, EC_POINT * po | |||
| 523 | ECerror(ERR_R_PASSED_NULL_PARAMETER); | 522 | ECerror(ERR_R_PASSED_NULL_PARAMETER); |
| 524 | return 0; | 523 | return 0; |
| 525 | } | 524 | } |
| 526 | return EC_POINT_set_Jprojective_coordinates_GFp(group, point, x, y, BN_value_one(), ctx); | 525 | return EC_POINT_set_Jprojective_coordinates(group, point, x, y, |
| 526 | BN_value_one(), ctx); | ||
| 527 | } | 527 | } |
| 528 | 528 | ||
| 529 | 529 | int | |
| 530 | int | ||
| 531 | ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP * group, const EC_POINT * point, | 530 | ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP * group, const EC_POINT * point, |
| 532 | BIGNUM * x, BIGNUM * y, BN_CTX * ctx) | 531 | BIGNUM * x, BIGNUM * y, BN_CTX * ctx) |
| 533 | { | 532 | { |
