EdwardsLimbOps class
Byte-level Ed25519 group operations on the limb backend
(EdwardsLimbPoint/Ed25519Fr): the BigInt-free replacement for the
ref10 CryptoOps/Ed25519Utils combination.
Conventions (identical to the code being replaced):
- scalars are 32-byte little-endian;
sc*CT entry points require canonical scalars (< L) and throw otherwise (fail-closed); scMulSub(a, b, c)returnsc − a·bandscMulAdd(a, b, c)returnsa·b + c(matching the oldCryptoOpsformulas);*PrecompPointVar/*BasePointVarmultiscalar helpers are vartime (public inputs: verify paths), ported 1:1 from the old slide-based algorithms.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
add(
List< int> a, List<int> b) → BuBytes -
addPoints(
EdwardsLimbPoint a, EdwardsLimbPoint b) → EdwardsLimbPoint - Point-level core: live point addition.
-
asPoint(
List< int> point) → EdwardsLimbPoint -
doubleScalarMult(
List< int> s1, List<int> p1, List<int> s2, List<int> p2) → BuBytes -
s1·p1 + s2·p2(straight-line ladder mults). -
doubleScalarMultBasePointVar(
{required List< int> a, required List<int> gABytes, required List<int> b}) → BuBytes -
a·gA + b·B(B = base point), vartime. -
doubleScalarMultPoints(
List< int> s1, EdwardsLimbPoint p1, List<int> s2, EdwardsLimbPoint p2) → EdwardsLimbPoint -
Point-level core:
s1·p1 + s2·p2on live points (straight-line mults). -
doubleScalarMultPrecompPoints(
List< int> a, List<EdwardsLimbPoint> aI, List<int> b, List<EdwardsLimbPoint> bI) → EdwardsLimbPoint -
a·A + b·Bfrom odd-multiple point tables (vartime). -
doubleScalarMultPrecompPointVar(
List< int> a, List<List< aIBytes, List<int> >int> b, List<List< bIBytes) → BuBytesint> > -
a·A + b·Bfrom odd-multiple tables (vartime). -
dsmPrecomp(
EdwardsLimbPoint point) → List< List< int> > -
Odd multiples
1P, 3P, .., 15Pas compressed bytes (vartime). -
dsmPrecompPoints(
EdwardsLimbPoint point) → List< EdwardsLimbPoint> -
Odd multiples
1P, 3P, .., 15Pas live points (vartime). -
dsmPrecompVar(
List< int> pointBytes) → List<List< int> > -
Odd multiples
1P, 3P, .., 15Pas compressed bytes (vartime). -
generator(
) → BuBytes -
hashToPoint(
List< int> data) → BuBytes - Maps 32 hashed bytes to a compressed point (Monero Elligator map). Vartime on the public hashed input.
-
hashToPointPoint(
List< int> data) → EdwardsLimbPoint - Point-level core: Monero Elligator map from hashed bytes to live point. Vartime on the public hashed input.
-
identity(
) → BuBytes -
maybeAsPoint(
List< int> point) → EdwardsLimbPoint? - Decodes a point, or null on invalid bytes.
-
mul8(
List< int> point) → BuBytes -
mul8Mult(
List< int> scalar, List<int> point) → BuBytes -
mul8MultPoint(
List< int> scalar, EdwardsLimbPoint point) → EdwardsLimbPoint -
Point-level core: 8 * (s * P) on live points, no intermediate encoding.
Fused
mult+mul8: avoids thetoBytes->fromBytesround-trip (invert + sqrt decode) ofmul8(mult(s, P)). -
mul8Point(
EdwardsLimbPoint point) → EdwardsLimbPoint - Point-level core: cofactor clearing on a live point.
-
mult(
List< int> scalar, List<int> point) → BuBytes -
multBase(
List< int> scalar) → BuBytes -
multBasePoint(
List< int> scalar) → EdwardsLimbPoint - Point-level core: scalar (bytes) times generator.
-
multPoint(
List< int> scalar, EdwardsLimbPoint point) → EdwardsLimbPoint - Point-level core: scalar (bytes) times live point.
-
neg(
List< int> point) → BuBytes -
reduceMultBase(
List< int> scalar) → BuBytes -
reduceMultBasePoint(
List< int> scalar) → EdwardsLimbPoint - Point-level core: reduced scalar (bytes) times generator.
-
scAdd(
List< int> a, List<int> b) → BuBytes -
scAddField(
Ed25519Fr a, Ed25519Fr b) → Ed25519Fr -
Fr-level scalar cores: live-object arithmetic, no bytes cross here.
The bytes
sc*entry points decode via_fr, run these, and encode on the way out (API boundary only). -
scCheck(
List< int> s) → bool -
True iff
sis a canonical (< L) 32-byte scalar, else false. -
scIsNonZero(
List< int> s) → bool - True iff any of the 32 bytes is non-zero (length-checked). Same semantics as the old byte-OR check: non-canonical inputs with a non-zero byte still report true.
-
scMul(
List< int> a, List<int> b) → BuBytes -
scMulAdd(
List< int> a, List<int> b, List<int> c) → BuBytes -
Returns
a·b + c. -
scMulAddField(
Ed25519Fr a, Ed25519Fr b, Ed25519Fr c) → Ed25519Fr -
Returns
a·b + c. -
scMulField(
Ed25519Fr a, Ed25519Fr b) → Ed25519Fr -
scMulSub(
List< int> a, List<int> b, List<int> c) → BuBytes -
Returns
c − a·b(matches the legacy formula). -
scMulSubField(
Ed25519Fr a, Ed25519Fr b, Ed25519Fr c) → Ed25519Fr -
Returns
c − a·b(matches the legacy formula). -
scNeg(
List< int> s) → BuBytes -
scNegField(
Ed25519Fr s) → Ed25519Fr -
scReduce32(
List< int> s) → BuBytes - Reduces an arbitrary 32-byte LE integer mod L.
-
scReduce64(
List< int> s) → BuBytes - Reduces a 64-byte LE integer mod L.
-
scReduceLong(
List< int> s) → BuBytes - Reduces an arbitrary-length little-endian integer mod L (Horner, base-256 field fold). Exact for any input length.
-
scSub(
List< int> a, List<int> b) → BuBytes -
scSubField(
Ed25519Fr a, Ed25519Fr b) → Ed25519Fr -
secretKeyToPubKey(
List< int> secretKey) → BuBytes -
slide(
List< int> r, List<int> a) → void - Reference slide (ref10): rewrites scalar bytes into signed digits.
-
sub(
List< int> a, List<int> b) → BuBytes -
subPoints(
EdwardsLimbPoint a, EdwardsLimbPoint b) → EdwardsLimbPoint - Point-level core: live point subtraction.
-
tripleScalarMultBasePointVar(
{required List< int> a, required List<int> b, required List<List< bIBytes, required List<int> >int> c, required List<List< cIBytes}) → BuBytesint> > -
a·B + b·P + c·Qwith base-table B (vartime). -
tripleScalarMultPrecompPointVar(
List< int> a, List<List< aIBytes, List<int> >int> b, List<List< bIBytes, List<int> >int> c, List<List< cIBytes) → BuBytesint> > -
a·A + b·B + c·Cfrom odd-multiple tables (vartime).