AffinePointt class
Represents a point in affine coordinates on an elliptic curve.
- Inheritance
-
- Object
- AbstractPoint
- AffinePointt
Constructors
- AffinePointt(CurveFp curve, BigInt x, BigInt y, {BigInt? order})
- AffinePointt.infinity(CurveFp curve)
-
Factory method to create an infinity point on the given curve.
factory
Properties
- curve → CurveFp
-
Represents the elliptic curve to which this point belongs.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- isInfinity → bool
-
Checks if this
AffinePointtrepresents the point at infinity (O), which is defined by having x and y coordinates both equal to zero.no setteroverride - order → BigInt?
-
Represents the order of this point, which is the number of times this point
can be added to itself before reaching the infinity point.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- x → BigInt
-
Represents the x-coordinate of this point in affine coordinates.
final
- y → BigInt
-
Represents the y-coordinate of this point in affine coordinates.
final
Methods
-
cast<
T extends AbstractPoint> () → T -
inherited
-
doublePoint(
) → AffinePointt -
Doubles the
AffinePointtby performing point doubling operation. It computes the new point representing the result of doubling this point on the elliptic curve. Ifthisis the point at infinity, it returns the point at infinity.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toBytes(
[EncodeType encodeType = EncodeType.comprossed]) → List< int> -
Converts the elliptic curve point to a byte array with the specified encoding type.
The default encoding type is 'compressed'.
inherited
-
toHex(
[EncodeType encodeType = EncodeType.comprossed]) → String -
Encodes the elliptic curve point as a hexadecimal string with the specified encoding type.
The default encoding type is 'compressed'.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator *(
BigInt other) → AffinePointt -
Overrides the multiplication operator (*) to perform point scalar
multiplication. It multiplies the
AffinePointtinstance by a scalarotherand returns a newAffinePointtrepresenting the result.override -
operator +(
AbstractPoint other) → AbstractPoint -
Overrides the addition operator (+) to perform point addition between this
AffinePointtand anotherAbstractPoint. The result is a newAffinePointt. If one of the points is the point at infinity, it returns the other point. If the x-coordinates of both points are equal, and the sum of their y-coordinates modulocurve.pequals zero, the result is the point at infinity. Otherwise, it computes the sum using the provided addition formula.override -
operator ==(
Object other) → bool -
Overrides the equality operator (==) to compare this
AffinePointtinstance with another object. It returnstrueif the other object is also anAffinePointtand if thecurve,x, andycoordinates match.override -
operator unary-(
) → AffinePointt - Negates this point and returns the result.