Remove |EC_POINT_make_affine| (dead code).

All the callers use |EC_POINTs_make_affine|.
This commit is contained in:
Brian Smith 2015-10-07 11:27:05 -10:00
parent 3e63ce6f9d
commit 75ccaf227a
6 changed files with 2 additions and 63 deletions

View File

@ -670,18 +670,6 @@ int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b,
return group->meth->point_cmp(group, a, b, ctx);
}
int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) {
if (group->meth->make_affine == 0) {
OPENSSL_PUT_ERROR(EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if (group->meth != point->meth) {
OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS);
return 0;
}
return group->meth->make_affine(group, point, ctx);
}
int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[],
BN_CTX *ctx) {
size_t i;

View File

@ -99,7 +99,6 @@ const EC_METHOD *EC_GFp_mont_method(void) {
ec_GFp_simple_is_at_infinity,
ec_GFp_simple_is_on_curve,
ec_GFp_simple_cmp,
ec_GFp_simple_make_affine,
ec_GFp_simple_points_make_affine,
0 /* mul */,
0 /* precompute_mult */,

View File

@ -142,8 +142,7 @@ typedef struct ec_method_st {
int (*point_cmp)(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b,
BN_CTX *);
/* used by EC_POINT_make_affine, EC_POINTs_make_affine: */
int (*make_affine)(const EC_GROUP *, EC_POINT *, BN_CTX *);
/* used by EC_POINTs_make_affine: */
int (*points_make_affine)(const EC_GROUP *, size_t num, EC_POINT * [],
BN_CTX *);

View File

@ -1918,7 +1918,7 @@ const EC_METHOD *EC_GFp_nistp256_method(void) {
0 /* point2oct */,
0 /* oct2point */, ec_GFp_simple_add, ec_GFp_simple_dbl,
ec_GFp_simple_invert, ec_GFp_simple_is_at_infinity,
ec_GFp_simple_is_on_curve, ec_GFp_simple_cmp, ec_GFp_simple_make_affine,
ec_GFp_simple_is_on_curve, ec_GFp_simple_cmp,
ec_GFp_simple_points_make_affine, ec_GFp_nistp256_points_mul,
0 /* precompute_mult */, 0 /* have_precompute_mult */,
ec_GFp_simple_field_mul, ec_GFp_simple_field_sqr, 0 /* field_div */,

View File

@ -101,7 +101,6 @@ const EC_METHOD *EC_GFp_simple_method(void) {
ec_GFp_simple_is_at_infinity,
ec_GFp_simple_is_on_curve,
ec_GFp_simple_cmp,
ec_GFp_simple_make_affine,
ec_GFp_simple_points_make_affine,
0 /* mul */,
0 /* precompute_mult */,
@ -1037,47 +1036,6 @@ end:
return ret;
}
int ec_GFp_simple_make_affine(const EC_GROUP *group, EC_POINT *point,
BN_CTX *ctx) {
BN_CTX *new_ctx = NULL;
BIGNUM *x, *y;
int ret = 0;
if (point->Z_is_one || EC_POINT_is_at_infinity(group, point)) {
return 1;
}
if (ctx == NULL) {
ctx = new_ctx = BN_CTX_new();
if (ctx == NULL) {
return 0;
}
}
BN_CTX_start(ctx);
x = BN_CTX_get(ctx);
y = BN_CTX_get(ctx);
if (y == NULL) {
goto err;
}
if (!EC_POINT_get_affine_coordinates_GFp(group, point, x, y, ctx) ||
!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) {
goto err;
}
if (!point->Z_is_one) {
OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR);
goto err;
}
ret = 1;
err:
BN_CTX_end(ctx);
BN_CTX_free(new_ctx);
return ret;
}
int ec_GFp_simple_points_make_affine(const EC_GROUP *group, size_t num,
EC_POINT *points[], BN_CTX *ctx) {
BN_CTX *new_ctx = NULL;

View File

@ -199,11 +199,6 @@ OPENSSL_EXPORT int EC_POINT_is_on_curve(const EC_GROUP *group,
OPENSSL_EXPORT int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a,
const EC_POINT *b, BN_CTX *ctx);
/* EC_POINT_make_affine converts |point| to affine form, internally. It returns
* one on success and zero otherwise. If |ctx| is not NULL, it may be used. */
OPENSSL_EXPORT int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point,
BN_CTX *ctx);
/* EC_POINTs_make_affine converts |num| points from |points| to affine form,
* internally. It returns one on success and zero otherwise. If |ctx| is not
* NULL, it may be used. */