summaryrefslogtreecommitdiffstats
path: root/crypto/bn
diff options
context:
space:
mode:
authorKaoruToda <kunnpuu@gmail.com>2017-10-09 20:05:58 +0900
committerMatt Caswell <matt@openssl.org>2017-10-09 13:17:09 +0100
commit208fb891e36f16d20262710c70ef0ff3df0e885c (patch)
tree514e6161c7c21122fced736efaddd87f5b5e0538 /crypto/bn
parent2e8b5d75afaff7c9b75917b750f997dc82336fac (diff)
Since return is inconsistent, I removed unnecessary parentheses and
unified them. - return (0); -> return 0; - return (1); -> return 1; - return (-1); -> return -1; Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4500)
Diffstat (limited to 'crypto/bn')
-rw-r--r--crypto/bn/bn_div.c6
-rw-r--r--crypto/bn/bn_lib.c12
-rw-r--r--crypto/bn/bn_mont.c6
-rw-r--r--crypto/bn/bn_mul.c2
-rw-r--r--crypto/bn/bn_prime.c2
-rw-r--r--crypto/bn/bn_recp.c4
-rw-r--r--crypto/bn/bn_shift.c12
-rw-r--r--crypto/bn/bn_word.c8
8 files changed, 26 insertions, 26 deletions
diff --git a/crypto/bn/bn_div.c b/crypto/bn/bn_div.c
index bd49e07dbc..6801eccdd1 100644
--- a/crypto/bn/bn_div.c
+++ b/crypto/bn/bn_div.c
@@ -34,7 +34,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
}
if (dv != NULL)
BN_zero(dv);
- return (1);
+ return 1;
}
BN_CTX_start(ctx);
@@ -187,7 +187,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
}
if (dv != NULL)
BN_zero(dv);
- return (1);
+ return 1;
}
BN_CTX_start(ctx);
@@ -411,7 +411,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
if (no_branch)
bn_correct_top(res);
BN_CTX_end(ctx);
- return (1);
+ return 1;
err:
bn_check_top(rm);
BN_CTX_end(ctx);
diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c
index f0a3bf1e3d..d22a83fc34 100644
--- a/crypto/bn/bn_lib.c
+++ b/crypto/bn/bn_lib.c
@@ -404,7 +404,7 @@ int BN_set_word(BIGNUM *a, BN_ULONG w)
a->d[0] = w;
a->top = (w ? 1 : 0);
bn_check_top(a);
- return (1);
+ return 1;
}
BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
@@ -587,7 +587,7 @@ int BN_cmp(const BIGNUM *a, const BIGNUM *b)
if (a != NULL)
return (-1);
else if (b != NULL)
- return (1);
+ return 1;
else
return (0);
}
@@ -599,7 +599,7 @@ int BN_cmp(const BIGNUM *a, const BIGNUM *b)
if (a->neg)
return (-1);
else
- return (1);
+ return 1;
}
if (a->neg == 0) {
gt = 1;
@@ -643,7 +643,7 @@ int BN_set_bit(BIGNUM *a, int n)
a->d[i] |= (((BN_ULONG)1) << j);
bn_check_top(a);
- return (1);
+ return 1;
}
int BN_clear_bit(BIGNUM *a, int n)
@@ -661,7 +661,7 @@ int BN_clear_bit(BIGNUM *a, int n)
a->d[i] &= (~(((BN_ULONG)1) << j));
bn_correct_top(a);
- return (1);
+ return 1;
}
int BN_is_bit_set(const BIGNUM *a, int n)
@@ -697,7 +697,7 @@ int BN_mask_bits(BIGNUM *a, int n)
a->d[w] &= ~(BN_MASK2 << b);
}
bn_correct_top(a);
- return (1);
+ return 1;
}
void BN_set_negative(BIGNUM *a, int b)
diff --git a/crypto/bn/bn_mont.c b/crypto/bn/bn_mont.c
index 975689432a..3585757da7 100644
--- a/crypto/bn/bn_mont.c
+++ b/crypto/bn/bn_mont.c
@@ -38,7 +38,7 @@ int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
r->neg = a->neg ^ b->neg;
r->top = num;
bn_correct_top(r);
- return (1);
+ return 1;
}
}
#endif
@@ -82,7 +82,7 @@ static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont)
nl = n->top;
if (nl == 0) {
ret->top = 0;
- return (1);
+ return 1;
}
max = (2 * nl); /* carry is stored separately */
@@ -159,7 +159,7 @@ static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont)
bn_correct_top(ret);
bn_check_top(ret);
- return (1);
+ return 1;
}
#endif /* MONT_WORD */
diff --git a/crypto/bn/bn_mul.c b/crypto/bn/bn_mul.c
index 36d1b4ecc8..fd6b4c2429 100644
--- a/crypto/bn/bn_mul.c
+++ b/crypto/bn/bn_mul.c
@@ -516,7 +516,7 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
if ((al == 0) || (bl == 0)) {
BN_zero(r);
- return (1);
+ return 1;
}
top = al + bl;
diff --git a/crypto/bn/bn_prime.c b/crypto/bn/bn_prime.c
index 026c119c13..0b98618a18 100644
--- a/crypto/bn/bn_prime.c
+++ b/crypto/bn/bn_prime.c
@@ -350,7 +350,7 @@ static int probable_prime(BIGNUM *rnd, int bits, prime_t *mods)
if (BN_num_bits(rnd) != bits)
goto again;
bn_check_top(rnd);
- return (1);
+ return 1;
}
int bn_probable_prime_dh(BIGNUM *rnd, int bits,
diff --git a/crypto/bn/bn_recp.c b/crypto/bn/bn_recp.c
index 80bfa2d38b..b82ff1656d 100644
--- a/crypto/bn/bn_recp.c
+++ b/crypto/bn/bn_recp.c
@@ -48,7 +48,7 @@ int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *d, BN_CTX *ctx)
BN_zero(&(recp->Nr));
recp->num_bits = BN_num_bits(d);
recp->shift = 0;
- return (1);
+ return 1;
}
int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
@@ -101,7 +101,7 @@ int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
return 0;
}
BN_CTX_end(ctx);
- return (1);
+ return 1;
}
/*
diff --git a/crypto/bn/bn_shift.c b/crypto/bn/bn_shift.c
index 6a1eec80af..b3e2751eb4 100644
--- a/crypto/bn/bn_shift.c
+++ b/crypto/bn/bn_shift.c
@@ -40,7 +40,7 @@ int BN_lshift1(BIGNUM *r, const BIGNUM *a)
r->top++;
}
bn_check_top(r);
- return (1);
+ return 1;
}
int BN_rshift1(BIGNUM *r, const BIGNUM *a)
@@ -53,7 +53,7 @@ int BN_rshift1(BIGNUM *r, const BIGNUM *a)
if (BN_is_zero(a)) {
BN_zero(r);
- return (1);
+ return 1;
}
i = a->top;
ap = a->d;
@@ -77,7 +77,7 @@ int BN_rshift1(BIGNUM *r, const BIGNUM *a)
if (!r->top)
r->neg = 0; /* don't allow negative zero */
bn_check_top(r);
- return (1);
+ return 1;
}
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
@@ -116,7 +116,7 @@ int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
r->top = a->top + nw + 1;
bn_correct_top(r);
bn_check_top(r);
- return (1);
+ return 1;
}
int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
@@ -138,7 +138,7 @@ int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
lb = BN_BITS2 - rb;
if (nw >= a->top || a->top == 0) {
BN_zero(r);
- return (1);
+ return 1;
}
i = (BN_num_bits(a) - n + (BN_BITS2 - 1)) / BN_BITS2;
if (r != a) {
@@ -171,5 +171,5 @@ int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
if (!r->top)
r->neg = 0; /* don't allow negative zero */
bn_check_top(r);
- return (1);
+ return 1;
}
diff --git a/crypto/bn/bn_word.c b/crypto/bn/bn_word.c
index 1af13a53fb..fd1aa41d0e 100644
--- a/crypto/bn/bn_word.c
+++ b/crypto/bn/bn_word.c
@@ -128,7 +128,7 @@ int BN_add_word(BIGNUM *a, BN_ULONG w)
a->d[i] = w;
}
bn_check_top(a);
- return (1);
+ return 1;
}
int BN_sub_word(BIGNUM *a, BN_ULONG w)
@@ -159,7 +159,7 @@ int BN_sub_word(BIGNUM *a, BN_ULONG w)
if ((a->top == 1) && (a->d[0] < w)) {
a->d[0] = w - a->d[0];
a->neg = 1;
- return (1);
+ return 1;
}
i = 0;
for (;;) {
@@ -175,7 +175,7 @@ int BN_sub_word(BIGNUM *a, BN_ULONG w)
if ((a->d[i] == 0) && (i == (a->top - 1)))
a->top--;
bn_check_top(a);
- return (1);
+ return 1;
}
int BN_mul_word(BIGNUM *a, BN_ULONG w)
@@ -197,5 +197,5 @@ int BN_mul_word(BIGNUM *a, BN_ULONG w)
}
}
bn_check_top(a);
- return (1);
+ return 1;
}