avoid side effects on right hand of logical operator
This commit is contained in:
parent
38f90d1b17
commit
64177349fc
@ -41,10 +41,12 @@ int mp_expt_d_ex (mp_int * a, mp_digit b, mp_int * c, int fast)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* square */
|
/* square */
|
||||||
if (b > 1 && (res = mp_sqr (&g, &g)) != MP_OKAY) {
|
if (b > 1) {
|
||||||
|
if ((res = mp_sqr (&g, &g)) != MP_OKAY) {
|
||||||
mp_clear (&g);
|
mp_clear (&g);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* shift to next bit */
|
/* shift to next bit */
|
||||||
b >>= 1;
|
b >>= 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user