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

new Group(x, y)

Parameters

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

Defined in

snarky.d.ts:1055

Properties

x

x: Field

Defined in

snarky.d.ts:1012


y

y: Field

Defined in

snarky.d.ts:1013


generator

Static generator: Group

Defined in

snarky.d.ts:1060

Methods

add

add(y): Group

Adds two Group elements together.

Parameters

NameType
yGroup

Returns

Group

Defined in

snarky.d.ts:1018


assertEquals

assertEquals(y, message?): void

Asserts that two Group elements are equal.

Parameters

NameType
yGroup
message?string

Returns

void

Defined in

snarky.d.ts:1039


equals

equals(y): Bool

Checks if two Group elements are equal.

Parameters

NameType
yGroup

Returns

Bool

Defined in

snarky.d.ts:1044


neg

neg(): Group

Negates this Group elements and returns a new instance.

Returns

Group

Defined in

snarky.d.ts:1028


scale

scale(y): Group

Scales this Group element using a Scalar.

Parameters

NameType
yScalar

Returns

Group

Defined in

snarky.d.ts:1033


sub

sub(y): Group

Subtracts one Group element from the other.

Parameters

NameType
yGroup

Returns

Group

Defined in

snarky.d.ts:1023


toJSON

toJSON(): Object

Returns the JSON representation of this Group element.

Returns

Object

NameType
xstring
ystring

Defined in

snarky.d.ts:1049


add

Static add(x, y): Group

Adds two Group elements together.

Parameters

NameType
xGroup
yGroup

Returns

Group

Defined in

snarky.d.ts:1064


assertEqual

Static assertEqual(x, y): void

Asserts that two Group elements are equal.

Parameters

NameType
xGroup
yGroup

Returns

void

Defined in

snarky.d.ts:1083


check

Static check(g): void

Parameters

NameType
gGroup

Returns

void

Defined in

snarky.d.ts:1121


equal

Static equal(x, y): Bool

Checks if two Group elements are equal.

Parameters

NameType
xGroup
yGroup

Returns

Bool

Defined in

snarky.d.ts:1088


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


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


neg

Static neg(x): Group

Negates a Group elements and returns a new instance.

Parameters

NameType
xGroup

Returns

Group

Defined in

snarky.d.ts:1072


scale

Static scale(x, y): Group

Scales this Group element using a Scalar.

Parameters

NameType
xGroup
yScalar

Returns

Group

Defined in

snarky.d.ts:1077


sizeInFields

Static sizeInFields(): number

Returns the size of this type.

Returns

number

Defined in

snarky.d.ts:1104


sub

Static sub(x, y): Group

Subtracts one Group element from the other.

Parameters

NameType
xGroup
yGroup

Returns

Group

Defined in

snarky.d.ts:1068


toAuxiliary

Static toAuxiliary(x?): []

Static method to serialize a Group into its auxiliary data.

Parameters

NameType
x?Group

Returns

[]

Defined in

snarky.d.ts:1096


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


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