On solaris, the variable name sun clashes, use s_un instead
[openssl.git] / crypto / ec / ecp_nistp224.c
index a2def18031c26104d2be240f343ae5a180c76184..a76b60fc31c3c0d712b62857f8e4d74e8d4d28cb 100644 (file)
@@ -1,4 +1,3 @@
-/* crypto/ec/ecp_nistp224.c */
 /*
  * Written by Emilia Kasper (Google) for the OpenSSL project.
  */
@@ -26,7 +25,9 @@
  */
 
 #include <openssl/opensslconf.h>
-#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
+#ifdef OPENSSL_NO_EC_NISTP_64_GCC_128
+NON_EMPTY_TRANSLATION_UNIT
+#else
 
 # include <stdint.h>
 # include <string.h>
@@ -1559,8 +1560,7 @@ int ec_GFp_nistp224_precompute_mult(EC_GROUP *group, BN_CTX *ctx)
     felem tmp_felems[32];
 
     /* throw away old precomputation */
-    EC_nistp224_pre_comp_free(group->pre_comp.nistp224);
-    group->pre_comp.nistp224 = NULL;
+    EC_pre_comp_free(group);
     if (ctx == NULL)
         if ((ctx = new_ctx = BN_CTX_new()) == NULL)
             return 0;
@@ -1584,8 +1584,7 @@ int ec_GFp_nistp224_precompute_mult(EC_GROUP *group, BN_CTX *ctx)
      */
     if (0 == EC_POINT_cmp(group, generator, group->generator, ctx)) {
         memcpy(pre->g_pre_comp, gmul, sizeof(pre->g_pre_comp));
-        ret = 1;
-        goto err;
+        goto done;
     }
     if ((!BN_to_felem(pre->g_pre_comp[0][1][0], group->generator->X)) ||
         (!BN_to_felem(pre->g_pre_comp[0][1][1], group->generator->Y)) ||
@@ -1663,6 +1662,7 @@ int ec_GFp_nistp224_precompute_mult(EC_GROUP *group, BN_CTX *ctx)
     }
     make_points_affine(31, &(pre->g_pre_comp[0][1]), tmp_felems);
 
+ done:
     SETPRECOMP(group, nistp224, pre);
     pre = NULL;
     ret = 1;
@@ -1679,6 +1679,4 @@ int ec_GFp_nistp224_have_precompute_mult(const EC_GROUP *group)
     return HAVEPRECOMP(group, nistp224);
 }
 
-#else
-static void *dummy = &dummy;
 #endif