Skip to main content

createForeignCurveV2

function createForeignCurveV2(params: CurveParams): typeof ForeignCurveV2

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 ForeignCurveV2 class represents a non-zero curve point and supports standard elliptic curve operations like point addition and scalar multiplication.

ForeignCurveV2 also includes to associated foreign fields: ForeignCurve.Field and ForeignCurve.Scalar, see createForeignFieldV2.

Parameters

params: CurveParams

Returns

typeof ForeignCurveV2

Source

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