diff options
author | Matt Caswell <matt@openssl.org> | 2015-01-16 09:21:50 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-01-22 09:23:58 +0000 |
commit | c695ebe2a09cb7f9aaec3c435ab94d36a6d6aece (patch) | |
tree | 582880155308c6a8953543a4de809a40b1a9354e /crypto/ec | |
parent | e19d4a99b8f25456dfab7086af57f3f208cdfed6 (diff) |
Additional comment changes for reformat of 1.0.2
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/ec')
-rw-r--r-- | crypto/ec/ec2_smpl.c | 3 | ||||
-rw-r--r-- | crypto/ec/ec_mult.c | 6 | ||||
-rw-r--r-- | crypto/ec/ecp_nistp521.c | 24 | ||||
-rw-r--r-- | crypto/ec/ecp_oct.c | 3 | ||||
-rw-r--r-- | crypto/ec/ecp_smpl.c | 9 |
5 files changed, 30 insertions, 15 deletions
diff --git a/crypto/ec/ec2_smpl.c b/crypto/ec/ec2_smpl.c index 350b59be91..0de9e73bae 100644 --- a/crypto/ec/ec2_smpl.c +++ b/crypto/ec/ec2_smpl.c @@ -544,7 +544,8 @@ int ec_GF2m_simple_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) } -/* Determines whether the given EC_POINT is an actual point on the curve defined +/*- + * Determines whether the given EC_POINT is an actual point on the curve defined * in the EC_GROUP. A point is valid if it satisfies the Weierstrass equation: * y^2 + x*y = x^3 + a*x^2 + b. */ diff --git a/crypto/ec/ec_mult.c b/crypto/ec/ec_mult.c index 4e805014a7..518525d85a 100644 --- a/crypto/ec/ec_mult.c +++ b/crypto/ec/ec_mult.c @@ -182,7 +182,8 @@ static void ec_pre_comp_clear_free(void *pre_) -/* Determine the modified width-(w+1) Non-Adjacent Form (wNAF) of 'scalar'. +/*- + * Determine the modified width-(w+1) Non-Adjacent Form (wNAF) of 'scalar'. * This is an array r[] of values that are either zero or odd with an * absolute value less than 2^w satisfying * scalar = \sum_j r[j]*2^j @@ -337,7 +338,8 @@ static signed char *compute_wNAF(const BIGNUM *scalar, int w, size_t *ret_len) (b) >= 20 ? 2 : \ 1)) -/* Compute +/*- + * Compute * \sum scalars[i]*points[i], * also including * scalar*generator diff --git a/crypto/ec/ecp_nistp521.c b/crypto/ec/ecp_nistp521.c index 613c5abc38..eec9f4220b 100644 --- a/crypto/ec/ecp_nistp521.c +++ b/crypto/ec/ecp_nistp521.c @@ -624,8 +624,10 @@ static void felem_reduce(felem out, const largefelem in) out[1] += ((limb) in[0]) >> 58; out[1] += (((limb) (in[0] >> 64)) & bottom52bits) << 6; - /* out[1] < 2^58 + 2^6 + 2^58 - * = 2^59 + 2^6 */ + /*- + * out[1] < 2^58 + 2^6 + 2^58 + * = 2^59 + 2^6 + */ out[2] += ((limb) (in[0] >> 64)) >> 52; out[2] += ((limb) in[1]) >> 58; @@ -654,8 +656,10 @@ static void felem_reduce(felem out, const largefelem in) out[8] += ((limb) in[7]) >> 58; out[8] += (((limb) (in[7] >> 64)) & bottom52bits) << 6; - /* out[x > 1] < 2^58 + 2^6 + 2^58 + 2^12 - * < 2^59 + 2^13 */ + /*- + * out[x > 1] < 2^58 + 2^6 + 2^58 + 2^12 + * < 2^59 + 2^13 + */ overflow1 = ((limb) (in[7] >> 64)) >> 52; overflow1 += ((limb) in[8]) >> 58; @@ -669,9 +673,11 @@ static void felem_reduce(felem out, const largefelem in) out[1] += overflow2; /* out[1] < 2^59 + 2^6 + 2^13 */ out[1] += out[0] >> 58; out[0] &= bottom58bits; - /* out[0] < 2^58 + /*- + * out[0] < 2^58 * out[1] < 2^59 + 2^6 + 2^13 + 2^2 - * < 2^59 + 2^14 */ + * < 2^59 + 2^14 + */ } static void felem_square_reduce(felem out, const felem in) @@ -1216,9 +1222,11 @@ static void point_add(felem x3, felem y3, felem z3, felem_scalar128(tmp2, 2); /* tmp2[i] < 17*2^121 */ felem_diff128(tmp, tmp2); - /* tmp[i] < 2^127 - 2^69 + 17*2^122 + /*- + * tmp[i] < 2^127 - 2^69 + 17*2^122 * = 2^126 - 2^122 - 2^6 - 2^2 - 1 - * < 2^127 */ + * < 2^127 + */ felem_reduce(y_out, tmp); copy_conditional(x_out, x2, z1_is_zero); diff --git a/crypto/ec/ecp_oct.c b/crypto/ec/ecp_oct.c index 374a0ee731..c23983d7f7 100644 --- a/crypto/ec/ecp_oct.c +++ b/crypto/ec/ecp_oct.c @@ -93,7 +93,8 @@ int ec_GFp_simple_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *po y = BN_CTX_get(ctx); if (y == NULL) goto err; - /* Recover y. We have a Weierstrass equation + /*- + * Recover y. We have a Weierstrass equation * y^2 = x^3 + a*x + b, * so y is one of the square roots of x^3 + a*x + b. */ diff --git a/crypto/ec/ecp_smpl.c b/crypto/ec/ecp_smpl.c index 4741bf9af3..c9fe1cf1db 100644 --- a/crypto/ec/ecp_smpl.c +++ b/crypto/ec/ecp_smpl.c @@ -864,8 +864,10 @@ int ec_GFp_simple_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_ if (!field_mul(group, n1, n0, n2, ctx)) goto err; if (!BN_mod_lshift1_quick(n0, n1, p)) goto err; if (!BN_mod_add_quick(n1, n0, n1, p)) goto err; - /* n1 = 3 * (X_a + Z_a^2) * (X_a - Z_a^2) - * = 3 * X_a^2 - 3 * Z_a^4 */ + /*- + * n1 = 3 * (X_a + Z_a^2) * (X_a - Z_a^2) + * = 3 * X_a^2 - 3 * Z_a^4 + */ } else { @@ -1035,7 +1037,8 @@ int ec_GFp_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_C int ec_GFp_simple_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx) { - /* return values: + /*- + * return values: * -1 error * 0 equal (in affine coordinates) * 1 not equal |