16 private bool homogeneous;
28 this.nonzero = P.nonzero;
29 this.homogeneous = P.homogeneous;
41 this.z = BigInteger.One;
42 this.t = BigInteger.Zero;
43 this.nonzero = !X.IsZero || !
Y.IsZero;
44 this.homogeneous =
false;
58 this.t = BigInteger.Zero;
59 this.nonzero = !X.IsZero || !
Y.IsZero;
60 this.homogeneous =
true;
76 this.nonzero = !X.IsZero || !
Y.IsZero;
77 this.homogeneous =
true;
86 internal set => this.x = value;
95 internal set => this.y = value;
107 this.homogeneous =
true;
120 this.homogeneous =
true;
130 internal set => this.nonzero = value;
138 get => this.homogeneous;
139 internal set => this.homogeneous = value;
155 StringBuilder sb =
new StringBuilder();
158 sb.Append(this.x.ToString());
160 sb.Append(this.y.ToString());
162 if (this.homogeneous)
165 sb.Append(this.z.ToString());
167 sb.Append(this.t.ToString());
172 return sb.ToString();
180 this.y.Equals(P.y) &&
181 this.z.Equals(P.z) &&
182 this.t.Equals(P.t) &&
183 this.nonzero.Equals(P.nonzero) &&
184 this.homogeneous.Equals(P.homogeneous);
191 this.x.GetHashCode() ^
192 this.y.GetHashCode() ^
193 this.z.GetHashCode() ^
194 this.t.GetHashCode() ^
195 this.nonzero.GetHashCode() ^
196 this.homogeneous.GetHashCode();
209 this.nonzero = C.nonzero;
210 this.homogeneous = C.homogeneous;
219 if (this.homogeneous)
223 this.z = BigInteger.One;
224 this.t = BigInteger.Zero;
225 this.homogeneous =
false;
229 this.x += Curve.
Prime;
232 this.y += Curve.
Prime;
BigInteger Divide(BigInteger a, BigInteger b)
Divides two numbers, modulus p
Base class of Elliptic curves over a prime field.
BigInteger Prime
Prime of curve.
ModulusP ModulusP
Arithmetic modulus p (the prime)
Represents a point on a curve.
override string ToString()
void Normalize(PrimeFieldCurve Curve)
Normalizes a point, if in homogeneous coorinates.
PointOnCurve(BigInteger X, BigInteger Y)
Represents a point on a curve.
PointOnCurve(PointOnCurve P)
Represents a point on a curve.
bool IsYZero
If the Y-coordinate is zero.
void CopyFrom(PointOnCurve C)
Copies the value from point C .
PointOnCurve(BigInteger X, BigInteger Y, BigInteger Z, BigInteger T)
Represents a point on a curve.
bool IsXZero
If the X-coordinate is zero.
override int GetHashCode()
PointOnCurve(BigInteger X, BigInteger Y, BigInteger Z)
Represents a point on a curve.
bool IsHomogeneous
If the point is in homogeneous coordinates.
override bool Equals(object obj)
bool NonZero
If the point is not zero (infinity).