}
SilcBool silc_mp_pow_mod(SilcMPInt *dst, SilcMPInt *mp1, SilcMPInt *exp,
- SilcMPInt *mod)
+ SilcMPInt *mod)
{
int ret;
if ((ret = tfm_fp_exptmod(mp1, exp, mod, dst))) {
const char *numxor =
"406442100086368525205432595008864090782598685309019707370392150093114259667017507345870606014161693990793563407656070252325154011";
+
int main(int argc, char **argv)
{
SilcBool success = FALSE;
{
int x, oldused;
- if (b->alloc < a->used + 1)
+ if (b->alloc <= a->used + 1)
if (tfm_fp_grow(b, a->used + 1))
return TFM_FP_MEM;
}
/* new leading digit? */
- if (r != 0 && b->used != (b->alloc-1)) {
+ if (r != 0) {
/* add a MSB which is always 1 at this point */
*tmpb = 1;
++(b->used);
tfm_fp_word w;
int x, oldused;
- if (c->alloc < a->used + 1)
+ if (c->alloc <= a->used + 1)
if (tfm_fp_grow(c, a->used + 1))
return TFM_FP_MEM;
c->dp[x] = (tfm_fp_digit)w;
w = w >> DIGIT_BIT;
}
- if (w != 0 && (a->used != a->alloc)) {
+ if (w != 0) {
c->dp[c->used++] = w;
++x;
}