Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bn_mp_div_d.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ mp_err mp_div_d(const mp_int *a, mp_digit b, mp_int *c, mp_digit *d)
}

/* three? */
if (MP_HAS(MP_DIV_3) && b == 3u) {
if (MP_HAS(MP_DIV_3) && (b == 3u)) {
return mp_div_3(a, c, d);
}

Expand Down
6 changes: 3 additions & 3 deletions bn_mp_exptmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ mp_err mp_exptmod(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y)

/* modified diminished radix reduction */
if (MP_HAS(MP_REDUCE_IS_2K_L) && MP_HAS(MP_REDUCE_2K_L) && MP_HAS(S_MP_EXPTMOD) &&
mp_reduce_is_2k_l(P) == MP_YES) {
(mp_reduce_is_2k_l(P) == MP_YES)) {
return s_mp_exptmod(G, X, P, Y, 1);
}

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

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

Expand Down
2 changes: 1 addition & 1 deletion bn_mp_mul.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mp_err mp_mul(const mp_int *a, const mp_int *b, mp_int *c)
* was actually slower on the author's machine, but YMMV.
*/
(min_len >= MP_KARATSUBA_MUL_CUTOFF) &&
(max_len / 2 >= MP_KARATSUBA_MUL_CUTOFF) &&
((max_len / 2) >= MP_KARATSUBA_MUL_CUTOFF) &&
/* Not much effect was observed below a ratio of 1:2, but again: YMMV. */
(max_len >= (2 * min_len))) {
err = s_mp_balance_mul(a,b,c);
Expand Down
4 changes: 2 additions & 2 deletions bn_mp_sqr.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ mp_err mp_sqr(const mp_int *a, mp_int *b)
{
mp_err err;
if (MP_HAS(S_MP_TOOM_SQR) && /* use Toom-Cook? */
a->used >= MP_TOOM_SQR_CUTOFF) {
(a->used >= MP_TOOM_SQR_CUTOFF)) {
err = s_mp_toom_sqr(a, b);
} else if (MP_HAS(S_MP_KARATSUBA_SQR) && /* Karatsuba? */
a->used >= MP_KARATSUBA_SQR_CUTOFF) {
(a->used >= MP_KARATSUBA_SQR_CUTOFF)) {
err = s_mp_karatsuba_sqr(a, b);
} else if (MP_HAS(S_MP_SQR_FAST) && /* can we use the fast comba multiplier? */
(((a->used * 2) + 1) < MP_WARRAY) &&
Expand Down