Skip to main content

createForeignCurve

function createForeignCurve(params: CurveParams): typeof ForeignCurve

Create a class representing an elliptic curve group, which is different from the native Group.

const Curve = createForeignCurve(Crypto.CurveParams.Secp256k1);

createForeignCurve(params) takes curve parameters CurveParams as input. We support modulus and order to be prime numbers up to 259 bits.

The returned ForeignCurveNotNeeded class represents a non-zero curve point and supports standard elliptic curve operations like point addition and scalar multiplication.

ForeignCurveNotNeeded also includes to associated foreign fields: ForeignCurve.Field and ForeignCurve.Scalar, see createForeignField.

Parameters

params: CurveParams

Returns

typeof ForeignCurve

Source

lib/provable/crypto/foreign-curve.ts:432