crypto/crypto/group/group library

Classes

BaseBls12Point<SCALAR extends JubJubField<SCALAR>, P extends BaseBls12Point<SCALAR, P>>
BaseJubJubAffinePoint<SCALAR extends JubJubScalar<SCALAR>>
Base class for affine JubJub points.
BaseJubJubNielsPoint<SCALAR extends JubJubScalar<SCALAR>>
Base class for Niels-form JubJub points (used for fast addition).
BaseJubJubPoint<SCALAR extends JubJubScalar<SCALAR>, P extends BaseJubJubPoint<SCALAR, P>>
Base abstract class for JubJub points with full group and cofactor operations.
BasePastaPoint<SCALAR extends PastaFieldElement<SCALAR>, BASE extends PastaFieldElement<BASE>>
Contract shared by every Pasta point representation (projective and affine).
BaseRedJubJubPoint<SCALAR extends JubJubScalar<SCALAR>>
Field elements are represented as multiple fixed-size limbs (typically 4 Uint64s) with algorithms written in a constant-time style. Because they rely on multi-precision arithmetic over Dart ints, these implementations are not guaranteed to be constant-time at the machine level and should not be considered fully side-channel resistant. Base abstract class for JubJub points in extended/projective coordinates.
Bls12AffinePoint<P extends Bls12Point<P>>
Affine-coordinate BLS12 point with limbs field elements.
Bls12Fp
Implementation of the BLS12-381 base field GF(p).
Bls12Fp12
Quadratic extension field GF(p¹²) over GF(p⁶), represented as c0 + c1·w with w² = v.
Bls12Fp2
Implements arithmetic over the quadratic extension field Fp2.
Bls12Fp6
Cubic extension field GF(p⁶) over GF(p²), represented as c0 + c1·v + c2·v² with v³ = u + 1.
Bls12FpConst
Constants for the BLS12-381 base field GF(p).
Bls12PairingUtils
Utilities for computing pairings and Miller loop operations on BLS12-381.
Bls12Point<P extends Bls12Point<P>>
Generic BLS12 point using limbs field representation (field elements are split into limbs).
BlsField<F extends BlsField<F>>
Base interface for BLS scalar or base fields.
BlsG1Constants
Constants for hashing to BLS12-381 G1, per RFC 9380 §8.8.1 (suite BLS12381G1_XMD:SHA-256_SSWU_RO_).
BlsG2Constants
BLS12-381 G2 isogeny/SSWU constants. Generated data — do not hand-edit the numeric values.
BlsHashToG1
Hash-to-curve for BLS12-381 G1 (RFC 9380 suite BLS12381G1_XMD:SHA-256_SSWU_RO_) — the counterpart to BlsHashToG2 for min-signature-size BLS ciphersuites (G2 public keys, G1 signatures).
BlsHashToG2
RFC 9380 hash-to-curve for BLS12-381 G2 (SSWU map + isogeny).
Bn254Fp
Bn254Fp12
Bn254Fp2
Bn254Fp6
Bn254FpConst
Bn254Fr
Bn254FrConst
Bn254G1AffinePoint
Bn254G1CurveApi
BN254 (alt_bn128) G1 curve operations (no extras beyond CurveApi). Points are 64-byte uncompressed (EIP-197), scalars 32-byte big-endian. Only the native (Rust) implementation exists; the pure-Dart implementation throws UnsupportedError.
Bn254G1Projective
Bn254G2AffinePoint
Bn254G2CurveApi
BN254 (alt_bn128) G2 curve operations (no extras beyond CurveApi). Points are 128-byte uncompressed (EIP-197 word order x1,x0,y1,y0), scalars 32-byte big-endian. Only the native (Rust) implementation exists; the pure-Dart implementation throws UnsupportedError.
Bn254G2Projective
Bn254Pairing
BnFp2SqrtResult
BnSqrtResult<T>
CofactorGroupElement<SCALAR extends CryptoField<SCALAR>, F extends CryptoGroupElement<F, SCALAR>>
Contract for a group element on a curve with a non-trivial cofactor.
Coordinates<F extends Object>
A pair of field-element coordinates (e.g. affine x/y).
CryptoField<F extends CryptoField<F>>
Contract for a field element (prime field or an extension field built on top of one).
CryptoFieldElement
Marker base for a field element type.
CryptoGroupElement<F, SCALAR extends CryptoField<SCALAR>>
Contract for a point on an elliptic curve group over scalar field SCALAR.
CryptoPrimeFieldElement<F extends CryptoPrimeFieldElement<F>>
A CryptoField element backed by a prime field (as opposed to an extension field).
CurveApi
Common byte-level curve operations, shared across every supported curve. pointLen/scalarLen vary per curve — e.g. 32 bytes for Ed25519, 48 for BLS12-381 G1.
DartBn254G1CurveApi
Pure-Dart BN254 (alt_bn128) G1 curve API.
DartBn254G2CurveApi
Pure-Dart BN254 (alt_bn128) G2 curve API.
DartG1ProjectiveCurveApi
Pure-Dart BLS12-381 G1 curve API.
DartG2ProjectiveCurveApi
Pure-Dart BLS12-381 G2 curve API.
DartJubJubCurveApi
Pure-Dart Jubjub curve API (Uint64 Montgomery JubJubFr / JubJubPoint).
DartPallasCurveApi
PallasCurveApi backed by the pure-Dart implementation in this package (PallasPoint with VestaFq as the scalar field).
DartVestaCurveApi
VestaCurveApi backed by the pure-Dart implementation in this package (VestaPoint with PallasFp as the scalar field).
DartX25519Api
X25519Api backed by the pure-Dart implementation in this package (X25519).
ECPoint<SCALAR extends Object, POINT extends ECPoint<SCALAR, POINT>>
Contract every elliptic-curve point implementation follows.
Ed25519CurveApi
Ed25519/EdDSA-specific curve operations, beyond the shared CurveApi.
Ed25519Fp
Ed25519FpConst
Ed25519Fr
Ed25519FrConst
EdwardsField<F extends EdwardsField<F>>
EdwardsLimbOps
Byte-level Ed25519 group operations on the limb backend (EdwardsLimbPoint/Ed25519Fr): the BigInt-free replacement for the ref10 CryptoOps/Ed25519Utils combination.
EdwardsLimbParams
EdwardsLimbPoint
EdwardsPrimeField<F extends EdwardsPrimeField<F>>
EdwardsScalar<F extends EdwardsScalar<F>>
FieldSqrtResult<F extends CryptoField<F>>
The result of a field square-root computation: the candidate result plus whether the input was actually a quadratic residue (isSquare).
G1AffinePoint
BLS12-381 G1 group in affine coordinates (x, y) plus infinity flag.
G1Projective
BLS12-381 G1 group in projective coordinates (x : y : z).
G1ProjectiveCurveApi
BLS12-381 G1: compressed (48) + uncompressed (96) forms.
G2AffinePoint
BLS12-381 G2 group afiine in projective coordinates (x : y : z) over GF(p²).
G2Prepared
Precomputes Miller loop coefficients for a G2 point to speed up pairings.
G2Projective
BLS12-381 G2 group in projective coordinates (x : y : z) over GF(p²).
G2ProjectiveCurveApi
BLS12-381 G2: compressed (96) + uncompressed (192) forms.
Gt
Element of GT, the BLS12-381 pairing target group, represented additively.
JubJubAffineNielsPoint
An affine JubJub point precomputed in Niels form (v+u, v-u, 2d*t).
JubJubAffinePoint
A JubJub point in affine coordinates (u, v).
JubJubCurveApi
JubJub curve operations, beyond the shared CurveApi.
JubJubField<F extends JubJubField<F>>
A JubJubPrimeField element of the base field Fq.
JubJubFq
Element of the JubJub base field Fq, internally represented as 4 64-bit limbs Uint64 in Montgomery form.
JubJubFqConst
JubJub base-field (Fq) domain parameters. Generated data — do not hand-edit the numeric values.
JubJubFr
Element of the JubJub scalar field Fr, internally represented as 4 64-bit limbs Uint64 in Montgomery form.
JubJubFrConst
JubJub scalar-field (Fr) domain parameters. Generated data — do not hand-edit the numeric values.
JubJubNielsPoint
A projective JubJub point precomputed in "Niels" form (v+u, v-u, z, 2d*t), the addend form used for fast mixed addition.
JubJubPoint
A JubJub point in extended coordinates (u, v, z, t1, t2), the main representation for group arithmetic.
JubJubPrimeField<F extends JubJubPrimeField<F>>
A JubJub prime-field element in Montgomery form, backed by 4 64-bit limbs.
JubJubScalar<F extends JubJubScalar<F>>
A JubJubPrimeField element of the scalar field Fr.
MillerLoopDriver<O>
Interface defining operations required to drive a Miller loop computation.
MillerLoopDriverBls12
Drives a multi-pairing Miller loop over a batch of (G1, prepared-G2) terms.
MillerLoopDriverBls12Pairing
Implements the Miller loop driver for BLS12-381 pairings using affine G1 and projective G2 points.
MillerLoopResultBls12
The accumulated (unreduced) output of the Miller loop; call MillerLoopResultBls12.finalExponentiation to get a Gt element.
MoneroH2C
Monero hash-to-point (Elligator2-style map + ×8 cofactor clearing).
MultiMillerLoop<TERMS extends Object, RESULT extends Object>
Interface for performing multi-Miller loop computations over multiple term pairs.
MultiMillerLoopBls12
Computes a combined Miller loop over multiple G1/G2 pairs for BLS12-381.
NativeBn254G1CurveApi
Bn254G1CurveApi backed by a native (FFI/platform) implementation.
NativeBn254G2CurveApi
Bn254G2CurveApi backed by a native (FFI/platform) implementation.
NativeG1ProjectiveCurveApi
G1ProjectiveCurveApi backed by a native (FFI/platform) implementation.
NativeG2ProjectiveCurveApi
G2ProjectiveCurveApi backed by a native (FFI/platform) implementation.
NativeJubJubCurveApi
JubJubCurveApi backed by a native (FFI/platform) implementation.
NativePallasCurveApi
PallasCurveApi backed by a native (FFI/platform) implementation.
NativeSecp256k1CurveApi
Secp256k1CurveApi backed by a native (FFI/platform) implementation.
NativeSecp256r1CurveApi
Secp256r1CurveApi backed by a native (FFI/platform) implementation.
NativeVestaCurveApi
VestaCurveApi backed by a native (FFI/platform) implementation.
NativeX25519Api
X25519Api backed by a native (FFI/platform) implementation.
PallasAffinePoint
A Pallas point in affine (Montgomery-limb) coordinates.
PallasCurveApi
Pallas curve operations, beyond the shared CurveApi.
PallasFp
Pallas base field (Fp) element, internally represented as 4 64-bit limbs Uint64 in Montgomery form. Also Vesta's scalar field.
PallasFPConst
Pallas base-field (Fp) domain parameters and isogeny constants. Generated data — do not hand-edit the numeric values.
PallasIsoAffinePoint
PallasIsoPoint in affine coordinates.
PallasIsoPoint
A point on the isogenous curve used to compute the Pallas SSWU hash-to-curve map, in projective coordinates.
PallasPoint
A Pallas point in projective (Montgomery-limb) coordinates.
PastaAffinePoint<SCALAR extends PastaFieldElement<SCALAR>, BASE extends PastaFieldElement<BASE>, P extends PastaPoint<SCALAR, BASE, P>>
A Pasta point in affine coordinates.
PastaCurveParams<F extends PastaFieldElement<F>>
A Pasta curve's Weierstrass coefficients (y^2 = x^3 + a*x + b).
PastaFieldElement<F extends PastaFieldElement<F>>
Abstract base class for elements of a Pasta prime field, supporting arithmetic, comparison, and byte/bit conversions.
PastaPoint<SCALAR extends PastaFieldElement<SCALAR>, BASE extends PastaFieldElement<BASE>, P extends PastaPoint<SCALAR, BASE, P>>
A Pasta point in projective coordinates, with full group and cofactor operations.
PastaSqrtTables<F extends PastaFieldElement<F>>
Precomputed lookup tables for the Pasta field square-root algorithm (sqrtAlt/sqrtRatio), a table-based variant of Tonelli-Shanks.
PastaUtils
Shared hash-to-curve and square-root helpers used by the Pasta curves.
RistrettoCurveApi
Ristretto group operations, beyond the shared CurveApi.
RistrettoPoint
A Ristretto255 point: a coset representative stored as an EdwardsLimbPoint in extended coordinates.
Secp256k1AffinePoint
Secp256k1CurveApi
secp256k1 curve operations: compressed (33) + uncompressed (65) forms.
Secp256k1Fp
Secp256k1FpConst
Secp256k1Fr
Secp256k1FrConst
Secp256k1Params
Secp256k1Point
Secp256r1AffinePoint
Secp256r1CurveApi
secp256r1 (NIST P-256): compressed (33) + uncompressed (65) forms.
Secp256r1Fp
Secp256r1FpConst
Secp256r1Fr
Secp256r1FrConst
Secp256r1Params
Secp256r1Point
UnsupportedEcPoint
A placeholder ECPoint for curves/operations that aren't implemented; every operation throws.
ValidatedBn254G1CurveApi
Bn254G1 with validation.
ValidatedBn254G2CurveApi
Bn254G2 with validation.
ValidatedCurveApi
Validates lengths on every CurveApi call, then delegates to inner.
ValidatedG1ProjectiveCurveApi
G1 with validation.
ValidatedG2ProjectiveCurveApi
G2 with validation.
ValidatedJubJubCurveApi
ValidatedCurveApi wrapper for a JubJubCurveApi implementation.
ValidatedPallasCurveApi
ValidatedCurveApi wrapper for a PallasCurveApi implementation.
ValidatedSecp256k1CurveApi
ValidatedCurveApi wrapper for a Secp256k1CurveApi implementation.
ValidatedSecp256r1CurveApi
ValidatedCurveApi wrapper for a Secp256r1CurveApi implementation.
ValidatedVestaCurveApi
ValidatedCurveApi wrapper for a VestaCurveApi implementation.
ValidatedX25519Api
X25519Api wrapper that validates every argument's length before delegating.
VestaAffinePoint
A Vesta point in affine (Montgomery-limb) coordinates.
VestaCurveApi
Vesta curve operations, beyond the shared CurveApi.
VestaFq
Vesta base field (Fq) element, internally represented as 4 64-bit limbs (Uint64) in Montgomery form. Also Pallas's scalar field.
VestaFQConst
Vesta base-field (Fq) domain parameters and isogeny constants. Generated data — do not hand-edit the numeric values.
VestaIsoAffinePoint
VestaIsoPoint in affine coordinates.
VestaIsoPoint
A point on the isogenous curve used to compute the Vesta SSWU hash-to-curve map, in projective coordinates.
VestaPoint
A Vesta point in projective (Montgomery-limb) coordinates.
WeierstrassCurveParams<B>
WeierstrassField<F extends WeierstrassField<F>>
WeierstrassPoint<SCALAR extends CryptoField<SCALAR>, BASE extends CryptoField<BASE>, P extends WeierstrassPoint<SCALAR, BASE, P>>
WeierstrassPrimeField<F extends WeierstrassPrimeField<F>>
WeierstrassScalar<F extends WeierstrassScalar<F>>
WeierstrassSecp256k1CurveApi
Secp256k1CurveApi backed by the limb-based Secp256k1Point.
WeierstrassSecp256r1CurveApi
Secp256r1CurveApi backed by the limb-based Secp256r1Point.
X25519
Implements scalar multiplication on Curve25519 using the Montgomery ladder. This is the basis for X25519 key agreement as described in RFC 7748.
X25519Api
X25519 (Curve25519 Diffie-Hellman, RFC 7748) operations.
X25519Keypair
Represents an X25519 keypair used for elliptic curve Diffie-Hellman (ECDH).

Enums

PastaCurveName
Field elements are represented as multiple fixed-size limbs (typically 4 Uint64s) with algorithms written in a constant-time style. Because they rely on multi-precision arithmetic over Dart ints, these implementations are not guaranteed to be constant-time at the machine level and should not be considered fully side-channel resistant. Identifies which of the four Pasta curves a point belongs to.

Functions

pastaCtEqualsMask(PastaFieldElement<PastaFieldElement> a, PastaFieldElement<PastaFieldElement> b) → Uint64
0/1 mask: 1 iff the field elements are equal. Fixed iteration count, no early exit.
pastaIsZeroMask(PastaFieldElement<PastaFieldElement> e) → Uint64
0/1 mask: 1 iff the field element is zero. Branch-free identity test for point arithmetic (no bool on secret data).