Skip to main content

Class: Group

Represents a point with x and y coordinates on an elliptic curve.

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Group(args)

Parameters

NameType
argsObject
args.xstring | number | boolean | Field
args.ystring | number | boolean | Field

Defined in

snarky.d.ts:884

new Group(x, y)

Parameters

NameType
xstring | number | boolean | Field
ystring | number | boolean | Field

Defined in

snarky.d.ts:888

Properties

x

x: Field

Defined in

snarky.d.ts:845


y

y: Field

Defined in

snarky.d.ts:846


generator

Static generator: Group

Defined in

snarky.d.ts:893

Methods

add

add(y): Group

Adds two Group elements together.

Parameters

NameType
yGroup

Returns

Group

Defined in

snarky.d.ts:851


assertEquals

assertEquals(y, message?): void

Asserts that two Group elements are equal.

Parameters

NameType
yGroup
message?string

Returns

void

Defined in

snarky.d.ts:872


equals

equals(y): Bool

Checks if two Group elements are equal.

Parameters

NameType
yGroup

Returns

Bool

Defined in

snarky.d.ts:877


neg

neg(): Group

Negates this Group elements and returns a new instance.

Returns

Group

Defined in

snarky.d.ts:861


scale

scale(y): Group

Scales this Group element using a Scalar.

Parameters

NameType
yScalar

Returns

Group

Defined in

snarky.d.ts:866


sub

sub(y): Group

Subtracts one Group element from the other.

Parameters

NameType
yGroup

Returns

Group

Defined in

snarky.d.ts:856


toJSON

toJSON(): Object

Returns the JSON representation of this Group element.

Returns

Object

NameType
xstring
ystring

Defined in

snarky.d.ts:882


add

Static add(x, y): Group

Adds two Group elements together.

Parameters

NameType
xGroup
yGroup

Returns

Group

Defined in

snarky.d.ts:897


assertEqual

Static assertEqual(x, y): void

Asserts that two Group elements are equal.

Parameters

NameType
xGroup
yGroup

Returns

void

Defined in

snarky.d.ts:916


check

Static check(g): void

Parameters

NameType
gGroup

Returns

void

Defined in

snarky.d.ts:954


equal

Static equal(x, y): Bool

Checks if two Group elements are equal.

Parameters

NameType
xGroup
yGroup

Returns

Bool

Defined in

snarky.d.ts:921


fromFields

Static fromFields(fields): Group

Creates a data structure from an array of serialized Field elements.

Parameters

NameType
fieldsField[]

Returns

Group

Defined in

snarky.d.ts:933


fromJSON

Static fromJSON(__namedParameters): null | Group

Deserialize a JSON structure into a Group. This operation does NOT affect the circuit and can't be used to prove anything about the string representation of the Field.

Parameters

NameType
__namedParametersObject
__namedParameters.xstring | number
__namedParameters.ystring | number

Returns

null | Group

Defined in

snarky.d.ts:947


neg

Static neg(x): Group

Negates a Group elements and returns a new instance.

Parameters

NameType
xGroup

Returns

Group

Defined in

snarky.d.ts:905


scale

Static scale(x, y): Group

Scales this Group element using a Scalar.

Parameters

NameType
xGroup
yScalar

Returns

Group

Defined in

snarky.d.ts:910


sizeInFields

Static sizeInFields(): number

Returns the size of this type.

Returns

number

Defined in

snarky.d.ts:937


sub

Static sub(x, y): Group

Subtracts one Group element from the other.

Parameters

NameType
xGroup
yGroup

Returns

Group

Defined in

snarky.d.ts:901


toAuxiliary

Static toAuxiliary(x?): []

Static method to serialize a Group into its auxiliary data.

Parameters

NameType
x?Group

Returns

[]

Defined in

snarky.d.ts:929


toFields

Static toFields(x): Field[]

Static method to serialize a Group into an array of Field elements.

Parameters

NameType
xGroup

Returns

Field[]

Defined in

snarky.d.ts:925


toJSON

Static toJSON(x): Object

Serialize a Group to a JSON string. This operation does NOT affect the circuit and can't be used to prove anything about the string representation of the Field.

Parameters

NameType
xGroup

Returns

Object

NameType
xstring
ystring

Defined in

snarky.d.ts:942