diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2021-04-20 17:38:03 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2021-04-20 17:38:03 +0000 |
commit | 35d10c1fd9772e9cb57842876e23f1b5aa6bb3b3 (patch) | |
tree | 537a3dbdf771ef9e9b91bcf65ae83e843b30b46c /lib/libcrypto/ec/ecp_smpl.c | |
parent | b865d25575023451abc9c66364356beeb597911c (diff) |
Fix indent of EC_METHODs as requested by jsing.
While there zap trailing whitespace from a KNF approximation gone wrong.
Diffstat (limited to 'lib/libcrypto/ec/ecp_smpl.c')
-rw-r--r-- | lib/libcrypto/ec/ecp_smpl.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/lib/libcrypto/ec/ecp_smpl.c b/lib/libcrypto/ec/ecp_smpl.c index 92234274594..96ab5bd44eb 100644 --- a/lib/libcrypto/ec/ecp_smpl.c +++ b/lib/libcrypto/ec/ecp_smpl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecp_smpl.c,v 1.31 2021/04/20 17:28:18 tb Exp $ */ +/* $OpenBSD: ecp_smpl.c,v 1.32 2021/04/20 17:38:02 tb Exp $ */ /* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> * for the OpenSSL project. * Includes code written by Bodo Moeller for the OpenSSL project. @@ -81,20 +81,20 @@ EC_GFp_simple_method(void) .group_get_curve = ec_GFp_simple_group_get_curve, .group_get_degree = ec_GFp_simple_group_get_degree, .group_check_discriminant = - ec_GFp_simple_group_check_discriminant, + ec_GFp_simple_group_check_discriminant, .point_init = ec_GFp_simple_point_init, .point_finish = ec_GFp_simple_point_finish, .point_clear_finish = ec_GFp_simple_point_clear_finish, .point_copy = ec_GFp_simple_point_copy, .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity, .point_set_Jprojective_coordinates = - ec_GFp_simple_set_Jprojective_coordinates, + ec_GFp_simple_set_Jprojective_coordinates, .point_get_Jprojective_coordinates = - ec_GFp_simple_get_Jprojective_coordinates, + ec_GFp_simple_get_Jprojective_coordinates, .point_set_affine_coordinates = - ec_GFp_simple_point_set_affine_coordinates, + ec_GFp_simple_point_set_affine_coordinates, .point_get_affine_coordinates = - ec_GFp_simple_point_get_affine_coordinates, + ec_GFp_simple_point_get_affine_coordinates, .add = ec_GFp_simple_add, .dbl = ec_GFp_simple_dbl, .invert = ec_GFp_simple_invert, @@ -129,7 +129,7 @@ EC_GFp_simple_method(void) */ -int +int ec_GFp_simple_group_init(EC_GROUP * group) { BN_init(&group->field); @@ -140,7 +140,7 @@ ec_GFp_simple_group_init(EC_GROUP * group) } -void +void ec_GFp_simple_group_finish(EC_GROUP * group) { BN_free(&group->field); @@ -149,7 +149,7 @@ ec_GFp_simple_group_finish(EC_GROUP * group) } -void +void ec_GFp_simple_group_clear_finish(EC_GROUP * group) { BN_clear_free(&group->field); @@ -158,7 +158,7 @@ ec_GFp_simple_group_clear_finish(EC_GROUP * group) } -int +int ec_GFp_simple_group_copy(EC_GROUP * dest, const EC_GROUP * src) { if (!BN_copy(&dest->field, &src->field)) @@ -174,7 +174,7 @@ ec_GFp_simple_group_copy(EC_GROUP * dest, const EC_GROUP * src) } -int +int ec_GFp_simple_group_set_curve(EC_GROUP * group, const BIGNUM * p, const BIGNUM * a, const BIGNUM * b, BN_CTX * ctx) { @@ -231,7 +231,7 @@ ec_GFp_simple_group_set_curve(EC_GROUP * group, } -int +int ec_GFp_simple_group_get_curve(const EC_GROUP * group, BIGNUM * p, BIGNUM * a, BIGNUM * b, BN_CTX * ctx) { int ret = 0; @@ -275,14 +275,14 @@ ec_GFp_simple_group_get_curve(const EC_GROUP * group, BIGNUM * p, BIGNUM * a, BI } -int +int ec_GFp_simple_group_get_degree(const EC_GROUP * group) { return BN_num_bits(&group->field); } -int +int ec_GFp_simple_group_check_discriminant(const EC_GROUP * group, BN_CTX * ctx) { int ret = 0; @@ -358,7 +358,7 @@ ec_GFp_simple_group_check_discriminant(const EC_GROUP * group, BN_CTX * ctx) } -int +int ec_GFp_simple_point_init(EC_POINT * point) { BN_init(&point->X); @@ -370,7 +370,7 @@ ec_GFp_simple_point_init(EC_POINT * point) } -void +void ec_GFp_simple_point_finish(EC_POINT * point) { BN_free(&point->X); @@ -379,7 +379,7 @@ ec_GFp_simple_point_finish(EC_POINT * point) } -void +void ec_GFp_simple_point_clear_finish(EC_POINT * point) { BN_clear_free(&point->X); @@ -389,7 +389,7 @@ ec_GFp_simple_point_clear_finish(EC_POINT * point) } -int +int ec_GFp_simple_point_copy(EC_POINT * dest, const EC_POINT * src) { if (!BN_copy(&dest->X, &src->X)) @@ -404,7 +404,7 @@ ec_GFp_simple_point_copy(EC_POINT * dest, const EC_POINT * src) } -int +int ec_GFp_simple_point_set_to_infinity(const EC_GROUP * group, EC_POINT * point) { point->Z_is_one = 0; @@ -633,7 +633,7 @@ ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP * group, const EC_POIN return ret; } -int +int ec_GFp_simple_add(const EC_GROUP * group, EC_POINT * r, const EC_POINT * a, const EC_POINT * b, BN_CTX * ctx) { int (*field_mul) (const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *); @@ -822,7 +822,7 @@ ec_GFp_simple_add(const EC_GROUP * group, EC_POINT * r, const EC_POINT * a, cons } -int +int ec_GFp_simple_dbl(const EC_GROUP * group, EC_POINT * r, const EC_POINT * a, BN_CTX * ctx) { int (*field_mul) (const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *); @@ -964,7 +964,7 @@ ec_GFp_simple_dbl(const EC_GROUP * group, EC_POINT * r, const EC_POINT * a, BN_C } -int +int ec_GFp_simple_invert(const EC_GROUP * group, EC_POINT * point, BN_CTX * ctx) { if (EC_POINT_is_at_infinity(group, point) > 0 || BN_is_zero(&point->Y)) @@ -975,14 +975,14 @@ ec_GFp_simple_invert(const EC_GROUP * group, EC_POINT * point, BN_CTX * ctx) } -int +int ec_GFp_simple_is_at_infinity(const EC_GROUP * group, const EC_POINT * point) { return BN_is_zero(&point->Z); } -int +int ec_GFp_simple_is_on_curve(const EC_GROUP * group, const EC_POINT * point, BN_CTX * ctx) { int (*field_mul) (const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *); @@ -1085,7 +1085,7 @@ ec_GFp_simple_is_on_curve(const EC_GROUP * group, const EC_POINT * point, BN_CTX } -int +int ec_GFp_simple_cmp(const EC_GROUP * group, const EC_POINT * a, const EC_POINT * b, BN_CTX * ctx) { /* @@ -1187,7 +1187,7 @@ ec_GFp_simple_cmp(const EC_GROUP * group, const EC_POINT * a, const EC_POINT * b } -int +int ec_GFp_simple_make_affine(const EC_GROUP * group, EC_POINT * point, BN_CTX * ctx) { BN_CTX *new_ctx = NULL; @@ -1225,7 +1225,7 @@ ec_GFp_simple_make_affine(const EC_GROUP * group, EC_POINT * point, BN_CTX * ctx } -int +int ec_GFp_simple_points_make_affine(const EC_GROUP * group, size_t num, EC_POINT * points[], BN_CTX * ctx) { BN_CTX *new_ctx = NULL; @@ -1271,11 +1271,11 @@ ec_GFp_simple_points_make_affine(const EC_GROUP * group, size_t num, EC_POINT * /* * The array is used as a binary tree, exactly as in heapsort: - * + * * heap[1] heap[2] heap[3] heap[4] heap[5] * heap[6] heap[7] heap[8]heap[9] heap[10]heap[11] * heap[12]heap[13] heap[14] heap[15] - * + * * We put the Z's in the last line; then we set each other node to the * product of its two child-nodes (where empty or 0 entries are * treated as ones); then we invert heap[1]; then we invert each @@ -1400,13 +1400,13 @@ ec_GFp_simple_points_make_affine(const EC_GROUP * group, size_t num, EC_POINT * } -int +int ec_GFp_simple_field_mul(const EC_GROUP * group, BIGNUM * r, const BIGNUM * a, const BIGNUM * b, BN_CTX * ctx) { return BN_mod_mul(r, a, b, &group->field, ctx); } -int +int ec_GFp_simple_field_sqr(const EC_GROUP * group, BIGNUM * r, const BIGNUM * a, BN_CTX * ctx) { return BN_mod_sqr(r, a, &group->field, ctx); @@ -1416,7 +1416,7 @@ ec_GFp_simple_field_sqr(const EC_GROUP * group, BIGNUM * r, const BIGNUM * a, BN * Apply randomization of EC point projective coordinates: * * (X, Y, Z) = (lambda^2 * X, lambda^3 * Y, lambda * Z) - * + * * where lambda is in the interval [1, group->field). */ int @@ -1686,7 +1686,7 @@ ec_GFp_simple_mul_ct(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, } /* one final cswap to move the right value into r */ EC_POINT_CSWAP(pbit, r, s, group_top, Z_is_one); - + ret = 1; err: |