Skip to content

Commit 07b479a

Browse files
authored
Merge pull request #263 from fperrad/20190514_lint
more linting
2 parents 4b334b4 + 91474f6 commit 07b479a

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

bn_mp_exptmod.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ mp_err mp_exptmod(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y)
6161

6262
#ifdef BN_MP_DR_IS_MODULUS_C
6363
/* is it a DR modulus? */
64-
dr = mp_dr_is_modulus(P) == MP_YES;
64+
dr = (mp_dr_is_modulus(P) == MP_YES) ? 1 : 0;
6565
#else
6666
/* default to no */
6767
dr = 0;
@@ -70,7 +70,7 @@ mp_err mp_exptmod(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y)
7070
#ifdef BN_MP_REDUCE_IS_2K_C
7171
/* if not, is it a unrestricted DR modulus? */
7272
if (dr == 0) {
73-
dr = (mp_reduce_is_2k(P) == MP_YES) << 1;
73+
dr = (mp_reduce_is_2k(P) == MP_YES) ? 2 : 0;
7474
}
7575
#endif
7676

bn_mp_reduce_is_2k.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ mp_bool mp_reduce_is_2k(const mp_int *a)
2929
iz = 1;
3030
}
3131
}
32+
return MP_YES;
33+
} else {
34+
return MP_YES;
3235
}
33-
return MP_YES;
3436
}
3537

3638
#endif

bn_mp_reduce_is_2k_l.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ mp_bool mp_reduce_is_2k_l(const mp_int *a)
2020
}
2121
}
2222
return (iy >= (a->used/2)) ? MP_YES : MP_NO;
23-
23+
} else {
24+
return MP_NO;
2425
}
25-
return MP_NO;
2626
}
2727

2828
#endif

bn_mp_sqrtmod_prime.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ mp_err mp_sqrtmod_prime(const mp_int *n, const mp_int *prime, mp_int *ret)
8181
/* M = S */
8282
mp_set_int(&two, 2uL);
8383

84-
res = MP_VAL;
8584
while (1) {
8685
if ((res = mp_copy(&T, &t1)) != MP_OKAY) goto cleanup;
8786
i = 0;

bn_s_mp_rand_jenkins.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
/* Bob Jenkins' http://burtleburtle.net/bob/rand/smallprng.html */
77
/* Chosen for speed and a good "mix" */
8-
typedef struct ranctx {
8+
typedef struct {
99
uint64_t a;
1010
uint64_t b;
1111
uint64_t c;

0 commit comments

Comments
 (0)