Beispiel #1
0
/* set this=O */
    public void inf()
    {
        INF = true;
        x.zero();
        y.zero();
        z.zero();
    }
Beispiel #2
0
/* construct this from x - but set to O if not on curve */
    public ECP2(FP2 ix)
    {
        x = new FP2(ix);
        y = new FP2(1);
        z = new FP2(1);
        FP2 rhs = RHS(x);

        if (rhs.sqrt())
        {
            y.copy(rhs);
            INF = false;
        }
        else
        {
            x.zero();
            INF = true;
        }
    }
Beispiel #3
0
/* construct this from (x,y) - but set to O if not on curve */
    public ECP2(FP2 ix, FP2 iy)
    {
        x = new FP2(ix);
        y = new FP2(iy);
        z = new FP2(1);
        FP2 rhs = RHS(x);
        FP2 y2  = new FP2(y);

        y2.sqr();
        if (y2.Equals(rhs))
        {
            INF = false;
        }
        else
        {
            x.zero();
            INF = true;
        }
    }
Beispiel #4
0
/* set this=0 */
    public void zero()
    {
        a.zero();
        b.zero();
    }