예제 #1
0
/* return a*b where result fits in a BIG */
    public static BIG smul(BIG a, BIG b)
    {
        long carry;
        BIG  c = new BIG(0);

        for (int i = 0; i < ROM.NLEN; i++)
        {
            carry = 0;
            for (int j = 0; j < ROM.NLEN; j++)
            {
                if (i + j < ROM.NLEN)
                {
                    carry = c.muladd(a.w[i], b.w[j], carry, i + j);
                }
            }
        }
        return(c);
    }