Point class
Point represents a point on the edwards25519 curve.
This type works similarly to math/big.Int, and all arguments and receivers are allowed to alias.
The zero value is NOT valid, and it may be used only as a receiver.
Constructors
- Point(Element x, Element y, Element z, Element t)
- Point.newGeneratorPoint()
-
NewGeneratorPoint returns a new Point set to the canonical generator.
factory
- Point.newIdentityPoint()
-
NewIdentityPoint returns a new Point set to the identity.
factory
- Point.zero()
-
Sets Point to zero
factory
Properties
- hashCode → int
-
ignore:
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- t ↔ Element
-
getter/setter pair
- x ↔ Element
-
The point is internally represented in extended coordinates (X, Y, Z, T)
where x = X/Z, y = Y/Z, and xy = T/Z per https://eprint.iacr.org/2008/522.
getter/setter pair
- y ↔ Element
-
getter/setter pair
- z ↔ Element
-
getter/setter pair
Methods
-
add(
Point p, Point q) → void - (Re)addition and subtraction. Add sets v = p + q, and returns v.
-
Bytes(
) → List< int> - Bytes returns the canonical 32-byte encoding of v, according to RFC 8032, Section 5.1.2.
-
bytes(
List< int> buf) → void -
BytesMontgomery(
) → List< int> - BytesMontgomery converts v to a point on the birationally-equivalent Curve25519 Montgomery curve, and returns its canonical 32 bytes encoding according to RFC 7748.
-
bytesMontgomery(
List< int> buf) → void -
copyFieldElement(
List< int> buf, Element v) → void -
equal(
Point u) → int - Equal returns 1 if v is equivalent to u, and 0 otherwise.
-
ExtendedCoordinates(
) → (Element, Element, Element, Element) - ExtendedCoordinates returns v in extended coordinates (X:Y:Z:T) where x = X/Z, y = Y/Z, and xy = T/Z as in https://eprint.iacr.org/2008/522.
-
extendedCoordinates(
List< Element> e) → (Element, Element, Element, Element) -
fromP1xP1(
projP1xP1 p) → void -
fromP2(
projP2 p) → void -
multByCofactor(
Point p) → void - MultByCofactor sets v = 8 * p, and returns v.
-
multiScalarMult(
List< Scalar> scalars, List<Point> points) → void -
negate(
Point p) → void - Negate sets v = -p, and returns v.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
scalarBaseMult(
Scalar x) → void - ScalarBaseMult sets v = x * B, where B is the canonical generator, and returns v.
-
scalarMult(
Scalar x, Point q) → void - ScalarMult sets v = x * q, and returns v.
-
set(
Point u) → void - Set sets v = u, and returns v.
-
setBytes(
Uint8List bytes) → void - SetBytes sets v = x, where x is a 32-byte encoding of v. If x does not represent a valid point on the curve, SetBytes returns nil and an error and the receiver is unchanged. Otherwise, SetBytes returns v.
-
setExtendedCoordinates(
Element X, Element Y, Element Z, Element T) → void - SetExtendedCoordinates sets v = (X:Y:Z:T) in extended coordinates where x = X/Z, y = Y/Z, and xy = T/Z as in https://eprint.iacr.org/2008/522.
-
subtract(
Point p, Point q) → void - Subtract sets v = p - q, and returns v.
-
toString(
) → String -
A string representation of this object.
inherited
-
varTimeDoubleScalarBaseMult(
Scalar a, Point A, Scalar b) → void - VarTimeDoubleScalarBaseMult sets v = a * A + b * B, where B is the canonical generator, and returns v.
-
varTimeMultiScalarMult(
List< Scalar> scalars, List<Point> points) → void
Operators
-
operator ==(
Object other) → bool -
Make the type not comparable (i.e. used with == or as a map key), as
equivalent points can be represented by different values.
override