X-Git-Url: https://git.openssl.org/gitweb/?a=blobdiff_plain;f=crypto%2Fec%2Fec2_smpl.c;h=5e37bfaca7ca7f993daccb869692c422a2ef05db;hb=b53e44e57259b2b015c54de8ecbcf4e06be23298;hp=b218c5639ac80aa7de91fce7575d3aad7b232a53;hpb=4c8f79a33e8efe5302700389edb4d574f2228765;p=openssl.git diff --git a/crypto/ec/ec2_smpl.c b/crypto/ec/ec2_smpl.c index b218c5639a..5e37bfaca7 100644 --- a/crypto/ec/ec2_smpl.c +++ b/crypto/ec/ec2_smpl.c @@ -9,19 +9,6 @@ * The ECC Code is licensed pursuant to the OpenSSL open source * license provided below. * - * In addition, Sun covenants to all licensees who provide a reciprocal - * covenant with respect to their own patents if any, not to sue under - * current and future patent claims necessarily infringed by the making, - * using, practicing, selling, offering for sale and/or otherwise - * disposing of the ECC Code as delivered hereunder (or portions thereof), - * provided that such covenant shall not apply: - * 1) for code that a licensee deletes from the ECC Code; - * 2) separates from the ECC Code; or - * 3) for infringements caused by: - * i) the modification of the ECC Code or - * ii) the combination of the ECC Code with other software or - * devices where such combination causes the infringement. - * * The software is originally written by Sheueling Chang Shantz and * Douglas Stebila of Sun Microsystems Laboratories. * @@ -234,16 +221,14 @@ int ec_GF2m_simple_group_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, if (!BN_copy(p, &group->field)) return 0; } - if (a != NULL || b != NULL) + if (a != NULL) { - if (a != NULL) - { - if (!BN_copy(a, &group->a)) goto err; - } - if (b != NULL) - { - if (!BN_copy(b, &group->b)) goto err; - } + if (!BN_copy(a, &group->a)) goto err; + } + + if (b != NULL) + { + if (!BN_copy(b, &group->b)) goto err; } ret = 1; @@ -364,11 +349,11 @@ int ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP *group, EC_POINT } if (!BN_copy(&point->X, x)) goto err; - point->X.neg = 0; + BN_set_sign(&point->X, 0); if (!BN_copy(&point->Y, y)) goto err; - point->Y.neg = 0; + BN_set_sign(&point->Y, 0); if (!BN_copy(&point->Z, BN_value_one())) goto err; - point->Z.neg = 0; + BN_set_sign(&point->Z, 0); point->Z_is_one = 1; ret = 1; @@ -399,12 +384,12 @@ int ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *group, const EC_ if (x != NULL) { if (!BN_copy(x, &point->X)) goto err; - x->neg = 0; + BN_set_sign(x, 0); } if (y != NULL) { if (!BN_copy(y, &point->Y)) goto err; - y->neg = 0; + BN_set_sign(y, 0); } ret = 1;