Remove comment tags from structs (coding style)
[openssl.git] / crypto / ec / ec_lcl.h
index 2cef3bced4ad86923cc48638a12d434cf599c886..ded35a72a0144124c693b38f8c13dee28d2c9ce6 100644 (file)
@@ -159,7 +159,7 @@ struct ec_method_st {
     int (*field_set_to_one) (const EC_GROUP *, BIGNUM *r, BN_CTX *);
     /* private key operations */
     size_t (*priv2oct)(const EC_KEY *eckey, unsigned char *buf, size_t len);
-    int (*oct2priv)(EC_KEY *eckey, unsigned char *buf, size_t len);
+    int (*oct2priv)(EC_KEY *eckey, const unsigned char *buf, size_t len);
     int (*set_private)(EC_KEY *eckey, const BIGNUM *priv_key);
     int (*keygen)(EC_KEY *eckey);
     int (*keycheck)(const EC_KEY *eckey);
@@ -169,7 +169,7 @@ struct ec_method_st {
     /* custom ECDH operation */
     int (*ecdh_compute_key)(unsigned char **pout, size_t *poutlen,
                             const EC_POINT *pub_key, const EC_KEY *ecdh);
-} /* EC_METHOD */ ;
+};
 
 /*
  * Types and functions to manipulate pre-computed values.
@@ -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;
@@ -240,12 +245,12 @@ struct ec_group_st {
         NISTZ256_PRE_COMP *nistz256;
         EC_PRE_COMP *ec;
     } pre_comp;
-} /* 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;
@@ -254,19 +259,13 @@ struct ec_key_st {
     EC_GROUP *group;
     EC_POINT *pub_key;
     BIGNUM *priv_key;
-    /*
-     * Arbitrary extra data.
-     * For example in X25519 this contains the raw private key in a 32 byte
-     * buffer.
-     */
-    void *custom_data;
     unsigned int enc_flag;
     point_conversion_form_t conv_form;
     int references;
     int flags;
     CRYPTO_EX_DATA ex_data;
     CRYPTO_RWLOCK *lock;
-} /* EC_KEY */ ;
+};
 
 struct ec_point_st {
     const EC_METHOD *meth;
@@ -280,12 +279,7 @@ struct ec_point_st {
                                  * Z) represents (X/Z^2, Y/Z^3) if Z != 0 */
     int Z_is_one;               /* enable optimized point arithmetics for
                                  * special case */
-    /*
-     * Arbitrary extra data.
-     * For example in X25519 this contains the public key in a 32 byte buffer.
-     */
-    void *custom_data;
-} /* EC_POINT */ ;
+};
 
 NISTP224_PRE_COMP *EC_nistp224_pre_comp_dup(NISTP224_PRE_COMP *);
 NISTP256_PRE_COMP *EC_nistp256_pre_comp_dup(NISTP256_PRE_COMP *);
@@ -553,7 +547,7 @@ const EC_METHOD *EC_GFp_nistz256_method(void);
 
 size_t ec_key_simple_priv2oct(const EC_KEY *eckey,
                               unsigned char *buf, size_t len);
-int ec_key_simple_oct2priv(EC_KEY *eckey, unsigned char *buf, size_t len);
+int ec_key_simple_oct2priv(EC_KEY *eckey, const unsigned char *buf, size_t len);
 int ec_key_simple_generate_key(EC_KEY *eckey);
 int ec_key_simple_generate_public_key(EC_KEY *eckey);
 int ec_key_simple_check_key(const EC_KEY *eckey);
@@ -585,7 +579,7 @@ struct ec_key_method_st {
                   const unsigned char *sigbuf, int sig_len, EC_KEY *eckey);
     int (*verify_sig)(const unsigned char *dgst, int dgst_len,
                       const ECDSA_SIG *sig, EC_KEY *eckey);
-} /* EC_KEY_METHOD */ ;
+};
 
 #define EC_KEY_METHOD_DYNAMIC   1
 
@@ -613,8 +607,6 @@ int ossl_ecdsa_verify(int type, const unsigned char *dgst, int dgst_len,
 int ossl_ecdsa_verify_sig(const unsigned char *dgst, int dgst_len,
                           const ECDSA_SIG *sig, EC_KEY *eckey);
 
-const EC_METHOD *ec_x25519_meth(void);
-
 int X25519(uint8_t out_shared_key[32], const uint8_t private_key[32],
            const uint8_t peer_public_value[32]);
 void X25519_public_from_private(uint8_t out_public_value[32],