fix groups example, add comments

This commit is contained in:
collin 2022-07-20 23:25:13 -07:00
parent a3e2944d55
commit 73fd21f198
3 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,7 @@
// The 'core' main function.
// This function takes as input a field `a` and calls several core circuit functions.
// Core circuit functions are built-in to the Leo language and call handwritten, optimized circuits in the AVM.
// To call a core circuit function, use the correct capitalized circuit identifier followed by two colons
// and then the function. Example: `Pedersen64::hash()`.
function main(a: field) -> field {
let b: field = BHP256::hash(a);
let c: field = Poseidon2::hash(b);

View File

@ -1,3 +1,4 @@
// The program input for groups/src/main.leo
// Leo will use provided string as the x coordinate and attempt to recover the y coordinate to form a group.
[main]
a: group = (7810607721416582242904415504650443951498042435501746664987470571546413371306, 1867362672570137759132108893390349941423731440336755218616442213142473202417)group;
a: group = 1817767092074430972953743941103352519057913259183777531581123188265134806220group;

View File

@ -1,4 +1,5 @@
// The 'groups' main function.
// This function takes a group coordinate as input `a` and performs several operations which should output the `0group`.
// Note that the operations can be called as associated functions on the `a` variable.
function main(a: group) -> group {
// unary
let e: group = a.double(); // 2a