Class: Group
Represents a point with x and y coordinates on an elliptic curve.
Table of contents
Constructors
Properties
Methods
- add
- assertEquals
- equals
- neg
- scale
- sub
- toJSON
- add
- assertEqual
- check
- equal
- fromFields
- fromJSON
- neg
- scale
- sizeInFields
- sub
- toAuxiliary
- toFields
- toJSON
Constructors
constructor
• new Group(args
)
Parameters
Name | Type |
---|---|
args | Object |
args.x | string | number | boolean | Field |
args.y | string | number | boolean | Field |
Defined in
• new Group(x
, y
)
Parameters
Name | Type |
---|---|
x | string | number | boolean | Field |
y | string | number | boolean | Field |
Defined in
Properties
x
• x: Field
Defined in
y
• y: Field
Defined in
generator
▪ Static
generator: Group
Defined in
Methods
add
▸ add(y
): Group
Adds two Group elements together.
Parameters
Name | Type |
---|---|
y | Group |
Returns
Defined in
assertEquals
▸ assertEquals(y
, message?
): void
Asserts that two Group elements are equal.
Parameters
Name | Type |
---|---|
y | Group |
message? | string |
Returns
void
Defined in
equals
▸ equals(y
): Bool
Checks if two Group elements are equal.
Parameters
Name | Type |
---|---|
y | Group |
Returns
Defined in
neg
▸ neg(): Group
Negates this Group elements and returns a new instance.
Returns
Defined in
scale
▸ scale(y
): Group
Scales this Group element using a Scalar.
Parameters
Name | Type |
---|---|
y | Scalar |
Returns
Defined in
sub
▸ sub(y
): Group
Subtracts one Group element from the other.
Parameters
Name | Type |
---|---|
y | Group |
Returns
Defined in
toJSON
▸ toJSON(): Object
Returns the JSON representation of this Group element.
Returns
Object
Name | Type |
---|---|
x | string |
y | string |
Defined in
add
▸ Static
add(x
, y
): Group
Adds two Group elements together.
Parameters
Name | Type |
---|---|
x | Group |
y | Group |
Returns
Defined in
assertEqual
▸ Static
assertEqual(x
, y
): void
Asserts that two Group elements are equal.
Parameters
Name | Type |
---|---|
x | Group |
y | Group |
Returns
void
Defined in
check
▸ Static
check(g
): void
Parameters
Name | Type |
---|---|
g | Group |
Returns
void
Defined in
equal
▸ Static
equal(x
, y
): Bool
Checks if two Group elements are equal.
Parameters
Name | Type |
---|---|
x | Group |
y | Group |
Returns
Defined in
fromFields
▸ Static
fromFields(fields
): Group
Creates a data structure from an array of serialized Field elements.
Parameters
Name | Type |
---|---|
fields | Field [] |
Returns
Defined in
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
Name | Type |
---|---|
«destructured» | Object |
› x | string | number |
› y | string | number |
Returns
null
| Group
Defined in
neg
▸ Static
neg(x
): Group
Negates a Group elements and returns a new instance.
Parameters
Name | Type |
---|---|
x | Group |
Returns
Defined in
scale
▸ Static
scale(x
, y
): Group
Scales this Group element using a Scalar.
Parameters
Name | Type |
---|---|
x | Group |
y | Scalar |
Returns
Defined in
sizeInFields
▸ Static
sizeInFields(): number
Returns the size of this type.
Returns
number
Defined in
sub
▸ Static
sub(x
, y
): Group
Subtracts one Group element from the other.
Parameters
Name | Type |
---|---|
x | Group |
y | Group |
Returns
Defined in
toAuxiliary
▸ Static
toAuxiliary(x?
): []
Static method to serialize a Group into its auxiliary data.
Parameters
Name | Type |
---|---|
x? | Group |
Returns
[]
Defined in
toFields
▸ Static
toFields(x
): Field
[]
Static method to serialize a Group into an array of Field elements.
Parameters
Name | Type |
---|---|
x | Group |
Returns
Field
[]
Defined in
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
Name | Type |
---|---|
x | Group |
Returns
Object
Name | Type |
---|---|
x | string |
y | string |