leo/examples/groups
Pranav Gaddamadugu d7813923d2 More examples
2022-10-06 00:17:51 -07:00
..
inputs fix groups example, add comments 2022-07-20 23:25:13 -07:00
src More examples 2022-10-06 00:17:51 -07:00
.gitignore add other examples 2022-07-20 16:07:37 -07:00
program.json add other examples 2022-07-20 16:07:37 -07:00
README.md [examples] Some doc fixes. 2022-09-21 00:07:10 -07:00

Leo group operations.

Build Guide

To compile this program, run:

leo build

To run this program, run:

leo run main

Overview

This example shows how to do basic operations over groups.

It takes the input data from inputs/groups.in

Documentation Group Element

The set of affine points on the elliptic curve passed into the Leo compiler forms a group. A subset of those points, defined by a chosen generator point, forms a subgroup of the group. Leo supports the set of points in this subgroup as a primitive data type. Group elements are special since their values can be defined as coordinate pairs (x, y)group. The group type keyword group must be used when specifying a pair of group coordinates since implicit syntax would collide with normal tuple (a, b) values.

let b = 0group; // the zero of the group

let a = 1group; // the group generator

let c = 2group; // 2 * the group generator

let d = (0, 1)group; // coordinate notation