X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcmath%2Ftma.c;h=d16852d28b7480eb0267e4c2aab216846bb463cb;hb=d4ead7075692a4abdc487fcb422cb9fd5b41a596;hp=b29353a3355bb98006766d5a4a6307a43b3c7205;hpb=f38b21315fc72df3914664227ebcece766f01f66;p=silc.git diff --git a/lib/silcmath/tma.c b/lib/silcmath/tma.c index b29353a3..d16852d2 100644 --- a/lib/silcmath/tma.c +++ b/lib/silcmath/tma.c @@ -426,6 +426,8 @@ int fast_s_tma_mp_mul_digs (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c, int /* number of output digits to produce */ pa = MIN(digs, a->used + b->used); + if (!pa) + return MP_VAL; /* clear the carry */ _W = 0; @@ -531,6 +533,9 @@ int fast_s_tma_mp_mul_high_digs (tma_mp_int * a, tma_mp_int * b, tma_mp_int * c, /* number of output digits to produce */ pa = a->used + b->used; + if (!pa) + return MP_VAL; + _W = 0; for (ix = digs; ix < pa; ix++) { int tx, ty, iy;