Code example for EllipticCurve

0
    { 
        // TODO: the Sun EC implementation doesn't currently handle the seed properly 
        // so at the moment it's set to null. Should probably look at making this configurable 
        if (curve instanceof ECCurve.Fp)
        { 
            return new EllipticCurve(new ECFieldFp(((ECCurve.Fp)curve).getQ()), curve.getA().toBigInteger(), curve.getB().toBigInteger(), null);
        } 
        else 
        { 
            ECCurve.F2m curveF2m = (ECCurve.F2m)curve;
            int ks[];
             
            if (curveF2m.isTrinomial())
            { 
                ks = new int[] { curveF2m.getK1() };
                 
                return new EllipticCurve(new ECFieldF2m(curveF2m.getM(), ks), curve.getA().toBigInteger(), curve.getB().toBigInteger(), null);
            } 
            else 
            { 
                ks = new int[] { curveF2m.getK3(), curveF2m.getK2(), curveF2m.getK1() };