ValidatedCurveApi class
Validates lengths on every CurveApi call, then delegates to inner.
Inner implementation should not re-validate; crypto failures surface as
CryptoException.
- Implemented types
- Implementers
Constructors
- ValidatedCurveApi(CurveApi inner, {String tag = 'CurveApi'})
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- inner → CurveApi
-
final
- 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
- tag → String
-
final
Methods
-
add(
List< int> a, List<int> b) → BuBytes -
Point addition; both pointLen bytes. Returns pointLen bytes. Throws on invalid encoding.
override
-
call<
T> (String op, T run()) → T -
Runs
run, wrapping any non-crypto exception asCryptoException. -
generator(
) → BuBytes -
Generator point. Returns pointLen bytes, never null.
override
-
identity(
) → BuBytes -
Identity (zero) point. Returns pointLen bytes, never null.
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
-
scAdd(
List< int> a, List<int> b) → BuBytes -
Scalar addition mod n; both scalarLen bytes. Returns scalarLen bytes. 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 -
scMul(
List< int> a, List<int> b) → BuBytes -
Scalar multiplication mod n; both scalarLen bytes. Returns scalarLen bytes. 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 -
scSub(
List< int> a, List<int> b) → BuBytes -
Scalar subtraction mod n; both scalarLen bytes. Returns scalarLen bytes. 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
-
validatePoint(
List< int> p, String op) → void -
Throws if
pisn't exactly pointLen bytes. -
validateScalar(
List< int> s, String op) → void -
Throws if
sisn't exactly scalarLen bytes.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited