explicit block
This commit is contained in:
parent
4430c6bc5f
commit
09b8fd9c98
|
@ -196,8 +196,9 @@ int mp_div (mp_int * a, mp_int * b, mp_int * c, mp_int * d)
|
|||
tmp = ((mp_word) x.dp[i]) << ((mp_word) DIGIT_BIT);
|
||||
tmp |= ((mp_word) x.dp[i - 1]);
|
||||
tmp /= ((mp_word) y.dp[t]);
|
||||
if (tmp > (mp_word) MP_MASK)
|
||||
if (tmp > (mp_word) MP_MASK) {
|
||||
tmp = MP_MASK;
|
||||
}
|
||||
q.dp[i - t - 1] = (mp_digit) (tmp & (mp_word) (MP_MASK));
|
||||
}
|
||||
|
||||
|
|
|
@ -49,12 +49,13 @@ int mp_mul (mp_int * a, mp_int * b, mp_int * c)
|
|||
res = fast_s_mp_mul_digs (a, b, c, digs);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
#ifdef BN_S_MP_MUL_DIGS_C
|
||||
res = s_mp_mul (a, b, c); /* uses s_mp_mul_digs */
|
||||
#else
|
||||
res = MP_VAL;
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
c->sign = (c->used > 0) ? neg : MP_ZPOS;
|
||||
return res;
|
||||
|
|
|
@ -21,8 +21,9 @@ int mp_shrink (mp_int * a)
|
|||
mp_digit *tmp;
|
||||
int used = 1;
|
||||
|
||||
if(a->used > 0)
|
||||
if(a->used > 0) {
|
||||
used = a->used;
|
||||
}
|
||||
|
||||
if (a->alloc != used) {
|
||||
if ((tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * used)) == NULL) {
|
||||
|
|
|
@ -42,11 +42,13 @@ mp_sqr (mp_int * a, mp_int * b)
|
|||
res = fast_s_mp_sqr (a, b);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
#ifdef BN_S_MP_SQR_C
|
||||
res = s_mp_sqr (a, b);
|
||||
#else
|
||||
res = MP_VAL;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
b->sign = MP_ZPOS;
|
||||
return res;
|
||||
|
|
Loading…
Reference in New Issue