Fix build errors with enable-ec_nistp_64_gcc_128
authorPeter Dettman <peter.dettman@bouncycastle.org>
Wed, 27 May 2015 13:56:14 +0000 (15:56 +0200)
committerEmilia Kasper <emilia@openssl.org>
Fri, 29 May 2015 10:40:53 +0000 (12:40 +0200)
RT 3871

Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/ec/ecp_nistp224.c
crypto/ec/ecp_nistp256.c
crypto/ec/ecp_nistp521.c

index 0e40db48a9d44080a3ce3c082cb04356208096ec..febfcab6f9927dfa1cd94b540050cc9bca67ee98 100644 (file)
@@ -1070,7 +1070,7 @@ static void select_point(const u64 idx, unsigned int size,
     unsigned i, j;
     limb *outlimbs = &out[0][0];
 
-    memset(out 0, sizeof(out));
+    memset(out, 0, sizeof(*out) * 3);
     for (i = 0; i < size; i++) {
         const limb *inlimbs = &pre_comp[i][0][0];
         u64 mask = i ^ idx;
index b4cd24d1fe6b95b84baf80c78cf950e20f6537d4..110984b1253751d53cfeb901568c3bb6ad0c2d66 100644 (file)
@@ -1625,7 +1625,7 @@ static void select_point(const u64 idx, unsigned int size,
     unsigned i, j;
     u64 *outlimbs = &out[0][0];
 
-    memset(out, 0, sizeof(out));
+    memset(out, 0, sizeof(*out) * 3);
 
     for (i = 0; i < size; i++) {
         const u64 *inlimbs = (u64 *)&pre_comp[i][0][0];
index 6e572f18d81e849f0f8c1ed92ce5c4741821169f..a5d7360bb913c45617a2e9d4e584a4c962d85c03 100644 (file)
@@ -1471,7 +1471,7 @@ static void select_point(const limb idx, unsigned int size,
     unsigned i, j;
     limb *outlimbs = &out[0][0];
 
-    memset(out, 0, sizeof(out));
+    memset(out, 0, sizeof(*out) * 3);
 
     for (i = 0; i < size; i++) {
         const limb *inlimbs = &pre_comp[i][0][0];
@@ -1906,7 +1906,7 @@ int ec_GFp_nistp521_points_mul(const EC_GROUP *group, EC_POINT *r,
         pre_comp = OPENSSL_malloc(sizeof(*pre_comp) * num_points);
         if (mixed)
             tmp_felems =
-                OPENSSL_malloc(sizeof(*tmp_felemts) * (num_points * 17 + 1));
+                OPENSSL_malloc(sizeof(*tmp_felems) * (num_points * 17 + 1));
         if ((secrets == NULL) || (pre_comp == NULL)
             || (mixed && (tmp_felems == NULL))) {
             ECerr(EC_F_EC_GFP_NISTP521_POINTS_MUL, ERR_R_MALLOC_FAILURE);
@@ -1918,7 +1918,7 @@ int ec_GFp_nistp521_points_mul(const EC_GROUP *group, EC_POINT *r,
          * i.e., they contribute nothing to the linear combination
          */
         memset(secrets, 0, sizeof(*secrets) * num_points);
-        memset(pre_comp, 0, sizseof(*pre_comp) * num_points);
+        memset(pre_comp, 0, sizeof(*pre_comp) * num_points);
         for (i = 0; i < num_points; ++i) {
             if (i == num)
                 /*