[openssl-commits] [openssl] master update
Rich Salz
rsalz at openssl.org
Mon Aug 29 15:20:26 UTC 2016
The branch master has been updated
via d196305aa0de1fc38837c27cb1ea6e60af9dd98d (commit)
via 66117ab0f6c21a7c123becd58bd38a736e551c43 (commit)
from 661a396373fbd2082eee4ad6829336219ec7dac6 (commit)
- Log -----------------------------------------------------------------
commit d196305aa0de1fc38837c27cb1ea6e60af9dd98d
Author: Rich Salz <rsalz at openssl.org>
Date: Mon Aug 29 09:07:38 2016 -0400
Remove comment tags from structs (coding style)
Reviewed-by: Richard Levitte <levitte at openssl.org>
commit 66117ab0f6c21a7c123becd58bd38a736e551c43
Author: Rich Salz <rsalz at openssl.org>
Date: Mon Aug 29 08:23:25 2016 -0400
Use uppercase name for PCT_ enum
Reviewed-by: Richard Levitte <levitte at openssl.org>
-----------------------------------------------------------------------
Summary of changes:
crypto/ec/ec_lcl.h | 27 ++++++++++++++++-----------
crypto/ec/ec_lib.c | 20 ++++++++++----------
2 files changed, 26 insertions(+), 21 deletions(-)
diff --git a/crypto/ec/ec_lcl.h b/crypto/ec/ec_lcl.h
index c67efef..ded35a7 100644
--- a/crypto/ec/ec_lcl.h
+++ b/crypto/ec/ec_lcl.h
@@ -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;
@@ -260,7 +265,7 @@ struct ec_key_st {
int flags;
CRYPTO_EX_DATA ex_data;
CRYPTO_RWLOCK *lock;
-} /* EC_KEY */ ;
+};
struct ec_point_st {
const EC_METHOD *meth;
@@ -274,7 +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 */
-} /* EC_POINT */ ;
+};
NISTP224_PRE_COMP *EC_nistp224_pre_comp_dup(NISTP224_PRE_COMP *);
NISTP256_PRE_COMP *EC_nistp256_pre_comp_dup(NISTP256_PRE_COMP *);
@@ -574,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
diff --git a/crypto/ec/ec_lib.c b/crypto/ec/ec_lib.c
index c592c06..7cb4bfe 100644
--- a/crypto/ec/ec_lib.c
+++ b/crypto/ec/ec_lib.c
@@ -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;
}
More information about the openssl-commits
mailing list