Skip to content

Commit c6e9e99

Browse files
authored
Merge pull request #335 from fperrad/20190902_lint
some linting
2 parents 7b79264 + b14c8e3 commit c6e9e99

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

bn_mp_div_d.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ mp_err mp_div_d(const mp_int *a, mp_digit b, mp_int *c, mp_digit *d)
4444
}
4545

4646
/* three? */
47-
if (MP_HAS(MP_DIV_3) && b == 3u) {
47+
if (MP_HAS(MP_DIV_3) && (b == 3u)) {
4848
return mp_div_3(a, c, d);
4949
}
5050

bn_mp_exptmod.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ mp_err mp_exptmod(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y)
4949

5050
/* modified diminished radix reduction */
5151
if (MP_HAS(MP_REDUCE_IS_2K_L) && MP_HAS(MP_REDUCE_2K_L) && MP_HAS(S_MP_EXPTMOD) &&
52-
mp_reduce_is_2k_l(P) == MP_YES) {
52+
(mp_reduce_is_2k_l(P) == MP_YES)) {
5353
return s_mp_exptmod(G, X, P, Y, 1);
5454
}
5555

5656
/* is it a DR modulus? default to no */
57-
dr = MP_HAS(MP_DR_IS_MODULUS) && mp_dr_is_modulus(P) == MP_YES ? 1 : 0;
57+
dr = (MP_HAS(MP_DR_IS_MODULUS) && (mp_dr_is_modulus(P) == MP_YES)) ? 1 : 0;
5858

5959
/* if not, is it a unrestricted DR modulus? */
60-
if (MP_HAS(MP_REDUCE_IS_2K) && dr == 0) {
60+
if (MP_HAS(MP_REDUCE_IS_2K) && (dr == 0)) {
6161
dr = (mp_reduce_is_2k(P) == MP_YES) ? 2 : 0;
6262
}
6363

bn_mp_mul.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ mp_err mp_mul(const mp_int *a, const mp_int *b, mp_int *c)
2121
* was actually slower on the author's machine, but YMMV.
2222
*/
2323
(min_len >= MP_KARATSUBA_MUL_CUTOFF) &&
24-
(max_len / 2 >= MP_KARATSUBA_MUL_CUTOFF) &&
24+
((max_len / 2) >= MP_KARATSUBA_MUL_CUTOFF) &&
2525
/* Not much effect was observed below a ratio of 1:2, but again: YMMV. */
2626
(max_len >= (2 * min_len))) {
2727
err = s_mp_balance_mul(a,b,c);

bn_mp_sqr.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ mp_err mp_sqr(const mp_int *a, mp_int *b)
88
{
99
mp_err err;
1010
if (MP_HAS(S_MP_TOOM_SQR) && /* use Toom-Cook? */
11-
a->used >= MP_TOOM_SQR_CUTOFF) {
11+
(a->used >= MP_TOOM_SQR_CUTOFF)) {
1212
err = s_mp_toom_sqr(a, b);
1313
} else if (MP_HAS(S_MP_KARATSUBA_SQR) && /* Karatsuba? */
14-
a->used >= MP_KARATSUBA_SQR_CUTOFF) {
14+
(a->used >= MP_KARATSUBA_SQR_CUTOFF)) {
1515
err = s_mp_karatsuba_sqr(a, b);
1616
} else if (MP_HAS(S_MP_SQR_FAST) && /* can we use the fast comba multiplier? */
1717
(((a->used * 2) + 1) < MP_WARRAY) &&

0 commit comments

Comments
 (0)