NativeEd25519CurveApi class
Ed25519CurveApi backed by a native (FFI/platform) implementation, falling back to DartEd25519CurveApi for operations the native API doesn't expose.
- Implemented types
Constructors
- NativeEd25519CurveApi(BuEd25519CurveApi _api)
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- pointLen → int
-
Compressed point length in bytes (curve-specific).
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scalarLen → int
-
Scalar length in bytes (curve-specific).
no setteroverride
Methods
-
add(
List< int> a, List<int> b) → BuBytes -
Point addition; both pointLen bytes. Returns pointLen bytes. Throws on invalid encoding.
override
-
addVar(
List< int> a, List<int> b) → BuBytes -
Point addition (variable-time); both 32-byte compressed. Returns 32-byte compressed point. Throws on invalid encoding.
override
-
doubleScalarMult(
List< int> s1, List<int> p1, List<int> s2, List<int> p2) → BuBytes -
Computes s1·p1 + s2·p2; scalars 32-byte LE, points 32-byte compressed. Returns 32-byte compressed point. Throws on invalid input.
override
-
geBaseDsmPrecompVar(
) → List< List< int> > - Fixed-base odd-multiples table (B, 3B, …, 15B). Call once and cache if you use the *BasePoint methods heavily.
-
geDoubleScalarMultBasePointVar(
{required List< int> a, required List<int> g, required List<int> b, List<List< ? basePrecomp}) → BuBytesint> > -
a·B + b·P;
a/b32-byte LE scalars,g/b32-byte compressed points. Returns 32-byte compressed point. Throws on invalid input.override -
geDoubleScalarMultPrecompPointVar(
List< int> a, List<List< aI, List<int> >int> b, List<List< bI) → BuBytesint> > -
a·A + b·B with precomputed tables
aI/bI(from geDsmPrecompVar); scalars 32-byte LE. Returns 32-byte compressed point. Throws on invalid input.override -
geDsmPrecompVar(
List< int> p) → List<List< int> > -
Builds the odd-multiples table used by the *Var double/triple scalar mults.
Returns
1P, 3P, 5P, 7P, 9P, 11P, 13P, 15Poverride -
generator(
) → BuBytes -
Generator point. Returns pointLen bytes, never null.
override
-
geTripleScalarMultBasePointVar(
{required List< int> a, required List<int> b, required List<List< bI, required List<int> >int> c, required List<List< cI, List<int> >List< ? basePrecomp}) → BuBytesint> > -
a·B + b·P + c·Q with precomputed
bI/cI; scalars 32-byte LE, points 32-byte compressed. Returns 32-byte compressed point. Throws on invalid input.override -
geTripleScalarMultPrecompPointVar(
List< int> a, List<List< aI, List<int> >int> b, List<List< bI, List<int> >int> c, List<List< cI) → BuBytesint> > -
a·A + b·B + c·C with precomputed
aI/bI/cI; scalars 32-byte LE. Returns 32-byte compressed point. Throws on invalid input.override -
hashToEc(
List< int> data) → BuBytes -
Maps 32-byte
datato a 32-byte compressed Edwards point (Elligator/hash-to-point). Throws on invalid length.override -
identity(
) → BuBytes -
Identity (zero) point. Returns pointLen bytes, never null.
override
-
mul8(
List< int> point) → BuBytes -
Multiplies
point(32-byte compressed) by the cofactor 8. Returns 32-byte compressed point. Throws on invalid encoding.override -
mul8Mult(
List< int> scalar, List<int> point) → BuBytes -
Fused
mul8(mult(scalar, point)): computes 8 * (scalar * point) without intermediate encoding;scalarandpointare 32-byte LE/compressed. Returns 32-byte compressed point. Throws on invalid input. Constant-time onscalar.override -
mulAdd(
List< int> s1, List<int> p1, List<int> s2, List<int> p2) → BuBytes -
Computes s1·p1 + s2·p2; scalars scalarLen bytes, points pointLen bytes. Returns pointLen bytes. Throws on invalid input.
override
-
mult(
List< int> scalar, List<int> point) → BuBytes -
Scalar-times-point;
scalaris scalarLen bytes,pointis pointLen bytes. Returns pointLen bytes. Throws on invalid input.override -
multBase(
List< int> scalar) → BuBytes -
Scalar-times-generator;
scalaris scalarLen bytes. Returns pointLen bytes. Throws on invalid scalar/point.override -
neg(
List< int> point) → BuBytes -
Point negation; pointLen bytes. Returns pointLen bytes. Throws on invalid encoding.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reduceMultBase(
List< int> scalar) → BuBytes -
Reduces
scalar(any length, 32-byte LE) then multiplies by base. Returns 32-byte compressed point. Throws on invalid input.override -
scAdd(
List< int> a, List<int> b) → BuBytes -
Scalar addition mod n; both scalarLen bytes. Returns scalarLen bytes. Throws on invalid scalar.
override
-
scAddVar(
List< int> a, List<int> b) → BuBytes -
Scalar addition (variable-time); both 32-byte LE. Returns 32-byte scalar. Throws on invalid scalar.
override
-
scCheck(
List< int> s) → bool -
True if
scalaris a canonically encoded scalar of scalarLen bytes, else false, never throws for length mismatch.override -
scIsNonZero(
List< int> s) → bool -
True if 32-byte LE
sis non-zero (and canonical), else false, never throws for bad length.override -
scMul(
List< int> a, List<int> b) → BuBytes -
Scalar multiplication mod n; both scalarLen bytes. Returns scalarLen bytes. Throws on invalid scalar.
override
-
scMulAdd(
List< int> a, List<int> b, List<int> c) → BuBytes -
Computes a·b + c; all 32-byte LE scalars. Returns 32-byte scalar. Throws on invalid scalar.
override
-
scMulAddVar(
List< int> scalar, List<int> scalar2, List<int> scalar3) → BuBytes -
Computes scalar·scalar2 + scalar3 (variable-time); all 32-byte LE. Returns 32-byte scalar. Throws on invalid scalar.
override
-
scMulSub(
List< int> a, List<int> b, List<int> c) → BuBytes -
Computes a·b − c; all 32-byte LE scalars. Returns 32-byte scalar. Throws on invalid scalar.
override
-
scMulVar(
List< int> a, List<int> b) → BuBytes -
Scalar multiplication (variable-time); both 32-byte LE. Returns 32-byte scalar. Throws on invalid scalar.
override
-
scNeg(
List< int> s) → BuBytes -
Scalar negation mod n; scalarLen bytes. Returns scalarLen bytes. Throws on invalid scalar.
override
-
scReduce(
List< int> s) → BuBytes -
Reduces arbitrary-length
smod n. Returns scalarLen bytes. Throws on empty input.override -
scReduce64(
List< int> s) → BuBytes -
Reduces 64-byte
smod L. Returns 32-byte LE scalar. Throws on invalid length.override -
scSub(
List< int> a, List<int> b) → BuBytes -
Scalar subtraction mod n; both scalarLen bytes. Returns scalarLen bytes. Throws on invalid scalar.
override
-
scSubVar(
List< int> a, List<int> b) → BuBytes -
Scalar subtraction (variable-time); both 32-byte LE. Returns 32-byte scalar. Throws on invalid scalar.
override
-
sub(
List< int> a, List<int> b) → BuBytes -
Point subtraction; both pointLen bytes. Returns pointLen bytes. Throws on invalid encoding.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited