Skip to content

Commit ea3afec

Browse files
committed
avoid shift
note: redmode becomes a good candidate for a new enum
1 parent 4b334b4 commit ea3afec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
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

0 commit comments

Comments
 (0)