Use uppercase name for PCT_ enum
authorRich Salz <rsalz@openssl.org>
Mon, 29 Aug 2016 12:23:25 +0000 (08:23 -0400)
committerRich Salz <rsalz@openssl.org>
Mon, 29 Aug 2016 13:06:24 +0000 (09:06 -0400)
Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/ec/ec_lcl.h
crypto/ec/ec_lib.c

index c67efef317200c0599bc69a01c51a81c196f1062..d01fb30e70a50f53471bf8cb3916d7fa501c8c97 100644 (file)
@@ -228,11 +228,16 @@ struct ec_group_st {
     /* data for ECDSA inverse */
     BN_MONT_CTX *mont_data;
 
-    /* precomputed values for speed. */
+    /*
+     * Precomputed values for speed. The PCT_xxx names match the
+     * pre_comp.xxx union names; see the SETPRECOMP and HAVEPRECOMP
+     * macros, below.
+     */
     enum {
-        pct_none,
-        pct_nistp224, pct_nistp256, pct_nistp521, pct_nistz256,
-        pct_ec } pre_comp_type;
+        PCT_none,
+        PCT_nistp224, PCT_nistp256, PCT_nistp521, PCT_nistz256,
+        PCT_ec
+    } pre_comp_type;
     union {
         NISTP224_PRE_COMP *nistp224;
         NISTP256_PRE_COMP *nistp256;
@@ -243,9 +248,9 @@ struct ec_group_st {
 } /* EC_GROUP */ ;
 
 #define SETPRECOMP(g, type, pre) \
-    g->pre_comp_type = pct_##type, g->pre_comp.type = pre
+    g->pre_comp_type = PCT_##type, g->pre_comp.type = pre
 #define HAVEPRECOMP(g, type) \
-    g->pre_comp_type == pct_##type && g->pre_comp.type != NULL
+    g->pre_comp_type == PCT_##type && g->pre_comp.type != NULL
 
 struct ec_key_st {
     const EC_KEY_METHOD *meth;
index c592c067a1cd6c68d70849a28ed5f93bccc5ab63..7cb4bfee284451e9b1e0ce56f12ecf42fcc6de0a 100644 (file)
@@ -69,22 +69,22 @@ void EC_pre_comp_free(EC_GROUP *group)
     default:
         break;
 #ifdef ECP_NISTZ256_REFERENCE_IMPLEMENTATION
-    case pct_nistz256:
+    case PCT_nistz256:
         EC_nistz256_pre_comp_free(group->pre_comp.nistz256);
         break;
 #endif
 #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
-    case pct_nistp224:
+    case PCT_nistp224:
         EC_nistp224_pre_comp_free(group->pre_comp.nistp224);
         break;
-    case pct_nistp256:
+    case PCT_nistp256:
         EC_nistp256_pre_comp_free(group->pre_comp.nistp256);
         break;
-    case pct_nistp521:
+    case PCT_nistp521:
         EC_nistp521_pre_comp_free(group->pre_comp.nistp521);
         break;
 #endif
-    case pct_ec:
+    case PCT_ec:
         EC_ec_pre_comp_free(group->pre_comp.ec);
         break;
     }
@@ -147,22 +147,22 @@ int EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src)
         dest->pre_comp.ec = NULL;
         break;
 #ifdef ECP_NISTZ256_REFERENCE_IMPLEMENTATION
-    case pct_nistz256:
+    case PCT_nistz256:
         dest->pre_comp.nistz256 = EC_nistz256_pre_comp_dup(src->pre_comp.nistz256);
         break;
 #endif
 #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
-    case pct_nistp224:
+    case PCT_nistp224:
         dest->pre_comp.nistp224 = EC_nistp224_pre_comp_dup(src->pre_comp.nistp224);
         break;
-    case pct_nistp256:
+    case PCT_nistp256:
         dest->pre_comp.nistp256 = EC_nistp256_pre_comp_dup(src->pre_comp.nistp256);
         break;
-    case pct_nistp521:
+    case PCT_nistp521:
         dest->pre_comp.nistp521 = EC_nistp521_pre_comp_dup(src->pre_comp.nistp521);
         break;
 #endif
-    case pct_ec:
+    case PCT_ec:
         dest->pre_comp.ec = EC_ec_pre_comp_dup(src->pre_comp.ec);
         break;
     }