Example #1
0
    public void redc(FF m, FF ND)
    {
        int n = m.length;
        FF  d = new FF(2 * n);

        mod(m);
        d.dscopy(this);
        copy(d.reduce(m, ND));
        mod(m);
    }
Example #2
0
    /* this*=y mod p */
    public void modsqr(FF p, FF nd)
    {
        //FF d=new FF(2*p.length);
        long ex = P_EXCESS();

        if ((ex + 1) * (ex + 1) + 1 >= P_FEXCESS)
        {
            mod(p);
        }
        FF d = sqr(this);

        copy(d.reduce(p, nd));
    }
Example #3
0
    /* this*=y mod p */
    public void modmul(FF y, FF p, FF nd)
    {
        //FF d=new FF(2*p.length);
        long ex = P_EXCESS();
        long ey = y.P_EXCESS();

        if ((ex + 1) * (ey + 1) + 1 >= P_FEXCESS)
        {
            mod(p);
        }
        FF d = mul(this, y);

        copy(d.reduce(p, nd));
    }