class Noble::Ed25519::ExtendedPoint
- Noble::Ed25519::ExtendedPoint
- Reference
- Object
Overview
Extended Point works in extended coordinates: (x, y, z, t) ∋ (x=x/z, y=y/z, t=xy). Default Point works in affine coordinates: (x, y) https://en.wikipedia.org/wiki/Twisted_Edwards_curve#Extended_coordinates
Defined in:
noble-ed25519.crConstant Summary
-
BASE =
ExtendedPoint.new(Curve::Gx, Curve::Gy, One, Noble::Ed25519.mod(Curve::Gx * Curve::Gy))
-
ZERO =
ExtendedPoint.new(Zero, One, One, Zero)
Constructors
Class Method Summary
- .normalizeZ(points : Array(ExtendedPoint)) : Array(ExtendedPoint)
-
.toAffineBatch(points : Array(ExtendedPoint)) : Array(Point)
Takes a bunch of Jacobian Points but executes only one invert on all of them.
Instance Method Summary
- #==(other : ExtendedPoint) : Bool
-
#add(other : ExtendedPoint)
Fast algo for adding 2 Extended Points when curve's a=-1.
-
#double : ExtendedPoint
Fast algo for doubling Extended Point when curve's a=-1.
-
#equals(other : ExtendedPoint) : Bool
Compare one point to another.
- #isSmallOrder : Bool
- #isTorsionFree : Bool
-
#multiply(scalar : Int, affinePoint : Point | Nil) : ExtendedPoint
Constant time multiplication.
-
#multiplyUnsafe(scalar : Int) : ExtendedPoint
Non-constant-time multiplication.
-
#negate : ExtendedPoint
Inverses point to one corresponding to (x, -y) in Affine coordinates.
- #subtract(other : ExtendedPoint) : ExtendedPoint
- #t : BigInt
- #t=(t : BigInt)
-
#toAffine(invZ : BigInt = Noble::Ed25519.invert(@z)) : Point
Converts Extended point to default (x, y) coordinates.
- #x : BigInt
- #x=(x : BigInt)
- #y : BigInt
- #y=(y : BigInt)
- #z : BigInt
- #z=(z : BigInt)
Constructor Detail
Class Method Detail
Takes a bunch of Jacobian Points but executes only one invert on all of them. invert is very slow operation, so this improves performance massively.
Instance Method Detail
Fast algo for adding 2 Extended Points when curve's a=-1.
http://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-add-2008-hwcd-4
Cost: 8M + 8add + 2*2.
Note: It does not check whether the other
point is valid.
Fast algo for doubling Extended Point when curve's a=-1. http://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#doubling-dbl-2008-hwcd Cost: 3M + 4S + 1a + 7add + 12.
Constant time multiplication. Uses wNAF method. Windowed method may be 10% faster, but takes 2x longer to generate and consumes 2x memory.
Non-constant-time multiplication. Uses double-and-add algorithm. It's faster, but should only be used when you don't care about an exposed private key e.g. sig verification. Allows scalar bigger than curve order, but less than 2^256
Converts Extended point to default (x, y) coordinates. Can accept precomputed Z^-1 - for example, from invertBatch.