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:1024

new Group(x, y)

Parameters

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

Defined in

snarky.d.ts:1028

Properties

x

x: Field

Defined in

snarky.d.ts:985


y

y: Field

Defined in

snarky.d.ts:986


generator

Static generator: Group

Defined in

snarky.d.ts:1033

Methods

add

add(y): Group

Adds two Group elements together.

Parameters

NameType
yGroup

Returns

Group

Defined in

snarky.d.ts:991


assertEquals

assertEquals(y, message?): void

Asserts that two Group elements are equal.

Parameters

NameType
yGroup
message?string

Returns

void

Defined in

snarky.d.ts:1012


equals

equals(y): Bool

Checks if two Group elements are equal.

Parameters

NameType
yGroup

Returns

Bool

Defined in

snarky.d.ts:1017


neg

neg(): Group

Negates this Group elements and returns a new instance.

Returns

Group

Defined in

snarky.d.ts:1001


scale

scale(y): Group

Scales this Group element using a Scalar.

Parameters

NameType
yScalar

Returns

Group

Defined in

snarky.d.ts:1006


sub

sub(y): Group

Subtracts one Group element from the other.

Parameters

NameType
yGroup

Returns

Group

Defined in

snarky.d.ts:996


toJSON

toJSON(): Object

Returns the JSON representation of this Group element.

Returns

Object

NameType
xstring
ystring

Defined in

snarky.d.ts:1022


add

Static add(x, y): Group

Adds two Group elements together.

Parameters

NameType
xGroup
yGroup

Returns

Group

Defined in

snarky.d.ts:1037


assertEqual

Static assertEqual(x, y): void

Asserts that two Group elements are equal.

Parameters

NameType
xGroup
yGroup

Returns

void

Defined in

snarky.d.ts:1056


check

Static check(g): void

Parameters

NameType
gGroup

Returns

void

Defined in

snarky.d.ts:1094


equal

Static equal(x, y): Bool

Checks if two Group elements are equal.

Parameters

NameType
xGroup
yGroup

Returns

Bool

Defined in

snarky.d.ts:1061


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:1073


fromJSON

Static fromJSON(«destructured»): 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 Group.

Parameters

NameType
«destructured»Object
› xstring | number
› ystring | number

Returns

null | Group

Defined in

snarky.d.ts:1087


neg

Static neg(x): Group

Negates a Group elements and returns a new instance.

Parameters

NameType
xGroup

Returns

Group

Defined in

snarky.d.ts:1045


scale

Static scale(x, y): Group

Scales this Group element using a Scalar.

Parameters

NameType
xGroup
yScalar

Returns

Group

Defined in

snarky.d.ts:1050


sizeInFields

Static sizeInFields(): number

Returns the size of this type.

Returns

number

Defined in

snarky.d.ts:1077


sub

Static sub(x, y): Group

Subtracts one Group element from the other.

Parameters

NameType
xGroup
yGroup

Returns

Group

Defined in

snarky.d.ts:1041


toAuxiliary

Static toAuxiliary(x?): []

Static method to serialize a Group into its auxiliary data.

Parameters

NameType
x?Group

Returns

[]

Defined in

snarky.d.ts:1069


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:1065


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 Group.

Parameters

NameType
xGroup

Returns

Object

NameType
xstring
ystring

Defined in

snarky.d.ts:1082