From dd616752a1ad3a4cae469ea9ceac50141debe32b Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Wed, 19 Jan 2011 14:42:42 +0000 Subject: [PATCH] oops, revert mistakenly committed EC changes --- crypto/ec/ec2_smpl.c | 19 +------------------ crypto/ec/ec_key.c | 8 +------- crypto/ec/ec_lcl.h | 2 -- crypto/ec/ecp_smpl.c | 11 +++-------- 4 files changed, 5 insertions(+), 35 deletions(-) diff --git a/crypto/ec/ec2_smpl.c b/crypto/ec/ec2_smpl.c index 00ad347b9a..cf357b462a 100644 --- a/crypto/ec/ec2_smpl.c +++ b/crypto/ec/ec2_smpl.c @@ -363,12 +363,7 @@ int ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP *group, EC_POINT if (!BN_copy(&point->Z, BN_value_one())) goto err; BN_set_negative(&point->Z, 0); point->Z_is_one = 1; - if (BN_num_bits(x) > BN_num_bits(&group->field)) - ret = 2; - else if (BN_num_bits(y) > BN_num_bits(&group->field)) - ret = 2; - else - ret = 1; + ret = 1; err: return ret; @@ -942,9 +937,6 @@ int ec_GF2m_simple_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT { return EC_POINT_is_at_infinity(group, b) ? 0 : 1; } - - if (EC_POINT_is_at_infinity(group, b)) - return 1; if (a->Z_is_one && b->Z_is_one) { @@ -975,15 +967,6 @@ int ec_GF2m_simple_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT return ret; } -int ec_GF2m_simple_range(const EC_GROUP *group, const EC_POINT *a) - { - if (BN_num_bits(&a->X) > BN_num_bits(&group->field)) - return 0; - if (BN_num_bits(&a->Y) > BN_num_bits(&group->field)) - return 0; - return 1; - } - /* Forces the given EC_POINT to internally use affine coordinates. */ int ec_GF2m_simple_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c index 522802c07a..12fb0e6d6d 100644 --- a/crypto/ec/ec_key.c +++ b/crypto/ec/ec_key.c @@ -304,13 +304,7 @@ int EC_KEY_check_key(const EC_KEY *eckey) ECerr(EC_F_EC_KEY_CHECK_KEY, ERR_R_PASSED_NULL_PARAMETER); return 0; } - - if (EC_POINT_is_at_infinity(eckey->group, eckey->pub_key)) - { - ECerr(EC_F_EC_KEY_CHECK_KEY, EC_R_POINT_AT_INFINITY); - goto err; - } - + if ((ctx = BN_CTX_new()) == NULL) goto err; if ((point = EC_POINT_new(eckey->group)) == NULL) diff --git a/crypto/ec/ec_lcl.h b/crypto/ec/ec_lcl.h index 4e9c4dab36..fd751e5eb1 100644 --- a/crypto/ec/ec_lcl.h +++ b/crypto/ec/ec_lcl.h @@ -323,7 +323,6 @@ int ec_GFp_simple_invert(const EC_GROUP *, EC_POINT *, BN_CTX *); int ec_GFp_simple_is_at_infinity(const EC_GROUP *, const EC_POINT *); int ec_GFp_simple_is_on_curve(const EC_GROUP *, const EC_POINT *, BN_CTX *); int ec_GFp_simple_cmp(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b, BN_CTX *); -int ec_GFp_simple_range(const EC_GROUP *group, const EC_POINT *a); int ec_GFp_simple_make_affine(const EC_GROUP *, EC_POINT *, BN_CTX *); int ec_GFp_simple_points_make_affine(const EC_GROUP *, size_t num, EC_POINT *[], BN_CTX *); int ec_GFp_simple_field_mul(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *); @@ -380,7 +379,6 @@ int ec_GF2m_simple_invert(const EC_GROUP *, EC_POINT *, BN_CTX *); int ec_GF2m_simple_is_at_infinity(const EC_GROUP *, const EC_POINT *); int ec_GF2m_simple_is_on_curve(const EC_GROUP *, const EC_POINT *, BN_CTX *); int ec_GF2m_simple_cmp(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b, BN_CTX *); -int ec_GF2m_simple_range(const EC_GROUP *group, const EC_POINT *a); int ec_GF2m_simple_make_affine(const EC_GROUP *, EC_POINT *, BN_CTX *); int ec_GF2m_simple_points_make_affine(const EC_GROUP *, size_t num, EC_POINT *[], BN_CTX *); int ec_GF2m_simple_field_mul(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *); diff --git a/crypto/ec/ecp_smpl.c b/crypto/ec/ecp_smpl.c index 3e56b71a21..4d26f8bdf6 100644 --- a/crypto/ec/ecp_smpl.c +++ b/crypto/ec/ecp_smpl.c @@ -441,11 +441,8 @@ int ec_GFp_simple_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POIN } point->Z_is_one = Z_is_one; } - - if (BN_cmp(&point->X, x) || BN_cmp(&point->Y, y)) - ret = 2; - else - ret = 1; + + ret = 1; err: if (new_ctx != NULL) @@ -1409,9 +1406,6 @@ int ec_GFp_simple_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT * { return EC_POINT_is_at_infinity(group, b) ? 0 : 1; } - - if (EC_POINT_is_at_infinity(group, b)) - return 1; if (a->Z_is_one && b->Z_is_one) { @@ -1500,6 +1494,7 @@ int ec_GFp_simple_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT * return ret; } + int ec_GFp_simple_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) { BN_CTX *new_ctx = NULL; -- 2.34.1