fix warnings
[openssl.git] / crypto / ec / ec2_smpl.c
index 2f2e7b7f1bf7afb957ab9d5dc822f1946deb26b0..a6fa4da7e6ce6a6fdc4f5e3ed8e91139221fef14 100644 (file)
@@ -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.
  *
@@ -112,8 +99,8 @@ const EC_METHOD *EC_GF2m_simple_method(void)
                ec_GF2m_simple_add,
                ec_GF2m_simple_dbl,
                ec_GF2m_simple_invert,
-               ec_GF2m_mont_mul,
-               ec_GF2m_mont_precompute_mult,
+               ec_GF2m_simple_mul,
+               ec_GF2m_precompute_mult,
                ec_GF2m_simple_is_at_infinity,
                ec_GF2m_simple_is_on_curve,
                ec_GF2m_simple_cmp,
@@ -183,8 +170,8 @@ int ec_GF2m_simple_group_copy(EC_GROUP *dest, const EC_GROUP *src)
        dest->poly[2] = src->poly[2];
        dest->poly[3] = src->poly[3];
        dest->poly[4] = src->poly[4];
-       bn_wexpand(&dest->a, (dest->poly[0] + BN_BITS2 - 1) / BN_BITS2);
-       bn_wexpand(&dest->b, (dest->poly[0] + BN_BITS2 - 1) / BN_BITS2);
+       bn_wexpand(&dest->a, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2);
+       bn_wexpand(&dest->b, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2);
        for (i = dest->a.top; i < dest->a.dmax; i++) dest->a.d[i] = 0;
        for (i = dest->b.top; i < dest->b.dmax; i++) dest->b.d[i] = 0;
        return 1;
@@ -208,12 +195,12 @@ int ec_GF2m_simple_group_set_curve(EC_GROUP *group,
 
        /* group->a */
        if (!BN_GF2m_mod_arr(&group->a, a, group->poly)) goto err;
-       bn_wexpand(&group->a, (group->poly[0] + BN_BITS2 - 1) / BN_BITS2);
+       bn_wexpand(&group->a, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2);
        for (i = group->a.top; i < group->a.dmax; i++) group->a.d[i] = 0;
        
        /* group->b */
        if (!BN_GF2m_mod_arr(&group->b, b, group->poly)) goto err;
-       bn_wexpand(&group->b, (group->poly[0] + BN_BITS2 - 1) / BN_BITS2);
+       bn_wexpand(&group->b, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2);
        for (i = group->b.top; i < group->b.dmax; i++) group->b.d[i] = 0;
                
        ret = 1;
@@ -362,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;
 
@@ -397,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;