public PointJacobian(BigInteger x, BigInteger y, EllipticCurveWeierstrass E) { this.x = x; this.y = y; this.z = 1; this.E = E; }
public PointAffine(BigInteger x, BigInteger y, BigInteger z, EllipticCurveWeierstrass E) { this.x = x; this.y = y; this.z = z; this.E = E; }
}//projective public static BigInteger GetFactorJacobian(BigInteger n, int B1, int B2) { BigInteger x, y, g; var E = EllipticCurveWeierstrass.GenerateCurveRandom(n, out x, out y, out g, false); var P = new PointJacobian(x, y, E); if (g > 1 && g < n) { return(g); } //STEP 1 var P1 = P as IPoint; var result = StageOneProjective(ref P1, n, B1); if (result > 1 || result == 0) { return(result); } //STEP 2 result = StageTwoProjective(ref P1, n, B1, B2); return(result); }//jacobian
public static BigInteger GetFactorAffine(BigInteger n, int B1, int B2) { BigInteger x, y, g; var E = EllipticCurveWeierstrass.GenerateCurveRandom(n, out x, out y, out g, false); var P = new PointAffine(x, y, E); if (g > 1 && g < n) { return(g); } //STEP 1 var P1 = P as IPoint; var result = StageOneAffine(ref P1, n, B1); if (result > 1 || result == 0) { return(result); } //STEP 2 P = P1 as PointAffine; result = StageTwoAffine(ref P1, n, B1, B2); return(result); }//first & second stage
public PointProjective(BigInteger x, BigInteger y, EllipticCurveWeierstrass E) { this.x = x; this.y = y; this.z = 1; this.E = E; }
public override bool Equals(Object obj) { if (obj == null) { return(false); } EllipticCurveWeierstrass E = obj as EllipticCurveWeierstrass; return(new EllipticCurveWeierstrass(this.a, this.b, this.n) == E); }