ProjectiveECCPoint class
Represents a point in projective coordinates on an elliptic curve.
- Inheritance
-
- Object
- AbstractPoint
- ProjectiveECCPoint
Constructors
- ProjectiveECCPoint({required CurveFp curve, required BigInt x, required BigInt y, required BigInt z, BigInt? order, bool generator = false})
-
Constructs a ProjectiveECCPoint from the given coordinates and optional order and generator flag.
The
curve
parameter specifies the elliptic curve.x
,y
, andz
are the projective coordinates of the point.order
is the order of the point, andgenerator
indicates if the point is a generator.factory - ProjectiveECCPoint.fromAffine(AbstractPoint point, {bool generator = false})
-
Constructs a ProjectiveECCPoint from an AffinePointt in affine coordinates.
factory
-
ProjectiveECCPoint.fromBytes({required CurveFp curve, required List<
int> data, BigInt? order}) -
Constructs a ProjectiveECCPoint from a byte representation.
The
curve
parameter specifies the elliptic curve, anddata
is the byte data.order
is the order of the point.factory - ProjectiveECCPoint.infinity(CurveFp curve)
-
Constructs a special ProjectiveECCPoint representing infinity on the elliptic curve.
The
curve
parameter specifies the elliptic curve.factory
Properties
- curve ↔ CurveFp
-
The elliptic curve associated with this point.
getter/setter pairoverride-getter
- generator ↔ bool
-
Indicates whether the point is a generator.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setteroverride
- isInfinity → bool
-
check if point is infinity
no setteroverride
- order → BigInt?
-
The order of the point (can be null if unknown).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- x → BigInt
-
Get the x-coordinate of this point in the projective elliptic curve coordinates.
no setteroverride
- y → BigInt
-
Get the y-coordinate of this point in projective elliptic curve coordinates.
no setteroverride
Methods
-
doublePoint(
) → ProjectiveECCPoint -
Doubles a point in projective coordinates on an elliptic curve and returns the result.
override
-
getCoords(
) → List< BigInt> -
mulAdd(
BigInt selfMul, AbstractPoint otherPoint, BigInt otherMul) → ProjectiveECCPoint -
Multiplies this point by a scalar value
selfMul
and adds another pointotherPoint
multiplied byotherMul
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
scale(
) → ProjectiveECCPoint - The coordinates are updated to the scaled values, and the scaled point is returned.
-
toAffine(
) → AffinePointt - Converts the projective point to an affine point.
-
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 scalar) → ProjectiveECCPoint -
Multiplies this point by a scalar value.
override
-
operator +(
AbstractPoint other) → AbstractPoint -
Adds another point to this point.
override
-
operator ==(
Object other) → bool -
equal operation
override
-
operator unary-(
) → ProjectiveECCPoint