Secp256k1 class

A Dart port of Bitcoin Core's secp256k1 library, focused on safety during scalar multiplication (ecmult) to mitigate timing and side-channel attacks.

⚠️ This is a beta version — some methods may be untested.

Note: The developer welcomes feedback, especially regarding timing and side-channel attack resistance in the context of Dart.

Constructors

Secp256k1.new()

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

ecmultConstTableGetGe(Secp256k1Ge r, List<Secp256k1Ge> pre, int n) → void
secp256k1CtzVar(BigInt x) int
secp256k1ECmultConst(Secp256k1Gej r, Secp256k1Ge a, Secp256k1Scalar q) → void
secp256k1ECmultConstOddMultiplesTableGlobalz(List<Secp256k1Ge> pre, Secp256k1Fe globalz, Secp256k1Gej a) → void
secp256k1EcmultConstXonly(Secp256k1Fe r, Secp256k1Fe n, Secp256k1Scalar q, {Secp256k1Fe? d, int knownOnCurve = 0}) int
secp256k1ECmultGen(Secp256k1ECmultGenContext ctx, Secp256k1Gej r, Secp256k1Scalar gn) → void
secp256k1ECmultGenScalarDiff(Secp256k1Scalar diff) → void
secp256k1ECmultOddMultiplesTable(int n, List<Secp256k1Ge> preA, List<Secp256k1Fe> zr, Secp256k1Fe z, Secp256k1Gej a) → void
secp256k1ECmultTableGetGe(Secp256k1Ge r, List<Secp256k1Ge> pre, int n, int w) → void
secp256k1ECmultTableGetGeLambda(Secp256k1Ge r, List<Secp256k1Ge> pre, List<Secp256k1Fe> x, int n, int w) → void
secp256k1EcmultTableVerify(int n, int w) → void
secp256k1FeAdd(Secp256k1Fe r, Secp256k1Fe a) → void
secp256k1FeAddInt(Secp256k1Fe r, int a) → void
secp256k1FeCmov(Secp256k1Fe r, Secp256k1Fe a, int flag) → void
secp256k1FeCmpVar(Secp256k1Fe a, Secp256k1Fe b) int
secp256k1FeEqual(Secp256k1Fe a, Secp256k1Fe b) int
secp256k1FeFromSigned62(Secp256k1Fe r, Secp256k1ModinvSigned a) → void
secp256k1FeFromStorage(Secp256k1Fe r, Secp256k1FeStorage a) → void
secp256k1FeGetB32(List<int> r, Secp256k1Fe a) → void
secp256k1FeGetBounds(Secp256k1Fe r, int m) → void
secp256k1FeHalf(Secp256k1Fe r) → void
secp256k1FeImplFromStorage(Secp256k1Fe r, Secp256k1FeStorage a) → void
secp256k1FeImplIsSquareVar(Secp256k1Fe x) int
secp256k1FeImplSetB32Limit(Secp256k1Fe r, List<int> a) int
secp256k1FeInv(Secp256k1Fe r, Secp256k1Fe x) → void
hh
secp256k1FeInvVar(Secp256k1Fe r, Secp256k1Fe x) → void
secp256k1FeIsOdd(Secp256k1Fe a) int
secp256k1FeIsQuad(Secp256k1Fe a) int
secp256k1FeIsSquareVar(Secp256k1Fe x) int
secp256k1FeIsZero(Secp256k1Fe a) int
secp256k1FeMul(Secp256k1Fe r, Secp256k1Fe a, Secp256k1Fe b) → void
secp256k1FeMulInt(Secp256k1Fe r, int a) → void
secp256k1FeNegate(Secp256k1Fe r, Secp256k1Fe a, int m) → void
secp256k1FeNormalize(Secp256k1Fe r) → void
secp256k1FeNormalizesToZero(Secp256k1Fe r) int
secp256k1FeNormalizesToZeroVar(Secp256k1Fe r) int
secp256k1FeNormalizeVar(Secp256k1Fe r) → void
secp256k1FeNormalizeWeak(Secp256k1Fe r) → void
secp256k1FeSetB32Mod(Secp256k1Fe r, List<int> a) → void
secp256k1FeSetInt(Secp256k1Fe r, int a) → void
secp256k1FeSqr(Secp256k1Fe r, Secp256k1Fe a) → void
secp256k1FeSqrt(Secp256k1Fe r, Secp256k1Fe a) int
secp256k1FeStorageCmov(Secp256k1FeStorage r, Secp256k1FeStorage a, int flag) → void
secp256k1FeToSigned62(Secp256k1ModinvSigned r, Secp256k1Fe a) → void
secp256k1FeToStorage(Secp256k1FeStorage r, Secp256k1Fe a) → void
secp256k1GeEqVar(Secp256k1Ge a, Secp256k1Ge b) int
secp256k1GeFromStorage(Secp256k1Ge r, Secp256k1GeStorage a) → void
secp256k1GeIsInfinity(Secp256k1Ge a) int
secp256k1GeIsValidVar(Secp256k1Ge a) int
secp256k1GejAddGe(Secp256k1Gej r, Secp256k1Gej a, Secp256k1Ge b) → void
secp256k1GejAddGeVar(Secp256k1Gej r, Secp256k1Gej a, Secp256k1Ge b, Secp256k1Fe? rzr) → void
secp256k1GejAddVar(Secp256k1Gej r, Secp256k1Gej a, Secp256k1Gej b, Secp256k1Fe? rzr) → void
secp256k1GejAddZinvVar(Secp256k1Gej r, Secp256k1Gej a, Secp256k1Ge b, Secp256k1Fe bzinv) → void
secp256k1GejCmov(Secp256k1Gej r, Secp256k1Gej a, int flag) → void
secp256k1GejDouble(Secp256k1Gej r, Secp256k1Gej a) → void
secp256k1GejDoubleVar(Secp256k1Gej r, Secp256k1Gej a, Secp256k1Fe? rzr) → void
secp256k1GejEqGeVar(Secp256k1Gej a, Secp256k1Ge b) int
secp256k1GejEqVar(Secp256k1Gej a, Secp256k1Gej b) int
secp256k1GejEqXVar(Secp256k1Fe x, Secp256k1Gej a) int
secp256k1GejIsInfinity(Secp256k1Gej a) int
secp256k1GejNeg(Secp256k1Gej r, Secp256k1Gej a) → void
secp256k1GejRescale(Secp256k1Gej r, Secp256k1Fe s) → void
secp256k1GejSetGe(Secp256k1Gej r, Secp256k1Ge a) → void
secp256k1GejSetInfinity(Secp256k1Gej r) → void
secp256k1GeMulLambda(Secp256k1Ge r, Secp256k1Ge a) → void
secp256k1GeNeg(Secp256k1Ge r, Secp256k1Ge a) → void
secp256k1GeSetAllGej(List<Secp256k1Ge> r, List<Secp256k1Gej> a, int len) → void
secp256k1GeSetAllGejVar(List<Secp256k1Ge> r, List<Secp256k1Gej> a, int len) → void
secp256k1GeSetGej(Secp256k1Ge r, Secp256k1Gej a) → void
secp256k1GeSetGejVar(Secp256k1Ge r, Secp256k1Gej a) → void
secp256k1GeSetGejZinv(Secp256k1Ge r, Secp256k1Gej a, Secp256k1Fe zi) → void
secp256k1GeSetGeZinv(Secp256k1Ge r, Secp256k1Ge a, Secp256k1Fe zi) → void
secp256k1GeSetInfinity(Secp256k1Ge r) → void
secp256k1GeSetXoVar(Secp256k1Ge r, Secp256k1Fe x, int odd) int
secp256k1GeSetXy(Secp256k1Ge r, Secp256k1Fe x, Secp256k1Fe y) → void
secp256k1GeStorageCmov(Secp256k1GeStorage r, Secp256k1GeStorage a, int flag) → void
secp256k1GeTableSetGlobalz(int len, List<Secp256k1Ge> a, List<Secp256k1Fe> zr) → void
secp256k1GeToStorage(Secp256k1GeStorage r, Secp256k1Ge a) → void
secp256k1GeXFracOnCurveVar(Secp256k1Fe xn, Secp256k1Fe xd) int
secp256k1GeXOnCurveVar(Secp256k1Fe x) int
secp256k1I128AccumMul(Secp256k1Int128 r, BigInt a, BigInt b) → void
secp256k1I128CheckPow2(Secp256k1Int128 r, int n, int sign) int
secp256k1I128Det(Secp256k1Int128 r, BigInt a, BigInt b, BigInt c, BigInt d) → void
secp256k1I128EqVar(Secp256k1Int128 a, Secp256k1Int128 b) int
secp256k1I128FromI64(Secp256k1Int128 r, BigInt a) → void
secp256k1I128Mul(Secp256k1Int128 r, BigInt a, BigInt b) → void
secp256k1I128Rshift(Secp256k1Int128 r, int n) → void
secp256k1I128ToI64(Secp256k1Int128 a) BigInt
secp256k1I128ToU64(Secp256k1Int128 a) BigInt
secp256k1Jacobi64MaybeVar(Secp256k1ModinvSigned x, Secp256k1ModinvInfo modinfo) int
Compute the Jacobi symbol of x modulo modinfo.modulus (variable time). gcd(x,modulus) must be 1.
secp256k1Modinv64(Secp256k1ModinvSigned x, Secp256k1ModinvInfo modinfo) → void
secp256k1Modinv64Abs(BigInt v) BigInt
secp256k1Modinv64DetCheckPow2(Secp256k1ModinvTrans t, int n, int abs) int
secp256k1Modinv64Divsteps59(BigInt zeta, BigInt f0, BigInt g0, Secp256k1ModinvTrans t) BigInt
secp256k1Modinv64Divsteps62Var(BigInt eta, BigInt f0, BigInt g0, Secp256k1ModinvTrans t) BigInt
secp256k1Modinv64Mul62(Secp256k1ModinvSigned r, Secp256k1ModinvSigned a, int alen, BigInt factor) → void
secp256k1Modinv64MulCmp62(Secp256k1ModinvSigned a, int alen, Secp256k1ModinvSigned b, BigInt factor) int
secp256k1Modinv64Normalize62(Secp256k1ModinvSigned r, BigInt sign, Secp256k1ModinvInfo modinfo) → void
secp256k1Modinv64Posdivsteps62var(BigInt eta, BigInt f0, BigInt g0, Secp256k1ModinvTrans t, int jacp) → (BigInt, int)
secp256k1Modinv64UpdateDe62(Secp256k1ModinvSigned d, Secp256k1ModinvSigned e, Secp256k1ModinvTrans t, Secp256k1ModinvInfo modinfo) → void
secp256k1Modinv64UpdateFg62(Secp256k1ModinvSigned f, Secp256k1ModinvSigned g, Secp256k1ModinvTrans t) → void
secp256k1Modinv64UpdateFg62Var(int len, Secp256k1ModinvSigned f, Secp256k1ModinvSigned g, Secp256k1ModinvTrans t) → void
secp256k1Modinv64Var(Secp256k1ModinvSigned x, Secp256k1ModinvInfo modinfo) → void
secp256k1Rotr32(int x, int by) int
secp256k1ScalarAdd(Secp256k1Scalar r, Secp256k1Scalar a, Secp256k1Scalar b) int
secp256k1ScalarCaddBit(Secp256k1Scalar r, int bit, int flag) → void
secp256k1ScalarCheckOverflow(Secp256k1Scalar a) int
secp256k1ScalarCmov(Secp256k1Scalar r, Secp256k1Scalar a, int flag) → void
secp256k1ScalarCondNegate(Secp256k1Scalar r, int flag) int
secp256k1ScalarEq(Secp256k1Scalar a, Secp256k1Scalar b) int
secp256k1ScalarFromSigned62(Secp256k1Scalar r, Secp256k1ModinvSigned a) → void
secp256k1ScalarGetB32(List<int> bin, Secp256k1Scalar a, {int offset = 0}) → void
secp256k1ScalarGetBitsLimb32(Secp256k1Scalar a, int offset, int count) int
secp256k1ScalarGetBitsVar(Secp256k1Scalar a, int offset, int count) int
secp256k1ScalarHalf(Secp256k1Scalar r, Secp256k1Scalar a) → void
secp256k1ScalarInverse(Secp256k1Scalar r, Secp256k1Scalar x) → void
secp256k1ScalarInverseVar(Secp256k1Scalar r, Secp256k1Scalar x) → void
secp256k1ScalarIsEven(Secp256k1Scalar a) int
secp256k1ScalarIsHigh(Secp256k1Scalar a) int
secp256k1ScalarIsOne(Secp256k1Scalar a) int
secp256k1ScalarIsZero(Secp256k1Scalar a) int
secp256k1ScalarMul(Secp256k1Scalar r, Secp256k1Scalar a, Secp256k1Scalar b) → void
secp256k1ScalarMul512(List<BigInt> l8, Secp256k1Scalar a, Secp256k1Scalar b) → void
secp256k1ScalarMulShiftVar(Secp256k1Scalar r, Secp256k1Scalar a, Secp256k1Scalar b, int shift) → void
secp256k1ScalarNegate(Secp256k1Scalar r, Secp256k1Scalar a) → void
secp256k1ScalarReduce(Secp256k1Scalar r, int overflow) int
secp256k1ScalarReduce512(Secp256k1Scalar r, List<BigInt> l) → void
secp256k1ScalarSetB32(Secp256k1Scalar r, List<int> b32) → void
secp256k1ScalarSetInt(Secp256k1Scalar r, int v) → void
secp256k1ScalarSplitLambda(Secp256k1Scalar r1, Secp256k1Scalar r2, Secp256k1Scalar k) → void
secp256k1ScalarToSigned62(Secp256k1ModinvSigned r, Secp256k1Scalar a) → void
secp256k1ScalarVerify(Secp256k1Scalar r) → void
secp256k1U128AccumMul(Secp256k1Uint128 r, BigInt a, BigInt b) → void
secp256k1U128AccumU64(Secp256k1Uint128 r, BigInt a) → void
secp256k1U128FromU64(Secp256k1Uint128 r, BigInt a) → void
secp256k1U128HiU64(Secp256k1Uint128 a) BigInt
secp256k1U128Mul(Secp256k1Uint128 r, BigInt a, BigInt b) → void
secp256k1U128Rshift(Secp256k1Uint128 r, int n) → void
secp256k1U128ToU64(Secp256k1Uint128 a) BigInt