example for cli

This commit is contained in:
Jaremy Creechley 2024-05-29 13:47:35 +01:00
parent c962462375
commit 8b831c6764
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300
15 changed files with 153 additions and 3 deletions

View File

@ -182,7 +182,8 @@ proc parseCliOptions(self: var CircomCircuit) =
"--name:proof_main"
]
for kind, key, value in getOpt(params):
# for kind, key, value in getOpt(params):
for kind, key, value in getOpt():
case kind
# Positional arguments
@ -239,7 +240,7 @@ proc run*() =
self.zkeyPath = dir / fmt"{self.circName}.zkey"
if self.inputsPath == "":
self.inputsPath = dir / fmt"input.json"
self.inputsPath = dir / fmt"inputs.json"
echo "Got file args: ", self
@ -249,7 +250,7 @@ proc run*() =
echo "\nERROR: must provide `" & name & "` file"
fileErrors = true
checkFile self.inputsPath, "inputs.json"
checkFile self.inputsPath, "input json"
checkFile self.r1csPath, "r1cs"
checkFile self.wasmPath, "wasm"
checkFile self.zkeyPath, "zkey"

View File

@ -0,0 +1 @@
{"a": "2","b": "3","c": "5"}

View File

@ -0,0 +1,28 @@
{
"pi_a": [
"9394338185732305719806011065134446911108323018457588286456961882986219363865",
"15746759809874621985987780715821363746217179062284140706010953533743322353143",
"1"
],
"pi_b": [
[
"11767400320831182291836719976706808438069844656325769591942922679870302275961",
"6655555805282541293507766019114818732448651987649641056472193412793000608658"
],
[
"165573447069789874882691451778743648261064383235713444940861981449848990224",
"19988792931394998924065924688231640113706338141254618060579448296980590803938"
],
[
"1",
"0"
]
],
"pi_c": [
"17909441321969125567799631222722899785743377975760647946061723535215534382510",
"11283272754750438996756092628724960121502710178397142080911723324462149051123",
"1"
],
"protocol": "groth16",
"curve": "bn128"
}

View File

@ -0,0 +1,3 @@
[
"30"
]

View File

@ -0,0 +1,94 @@
{
"protocol": "groth16",
"curve": "bn128",
"nPublic": 1,
"vk_alpha_1": [
"20491192805390485299153009773594534940189261866228447918068658471970481763042",
"9383485363053290200918347156157836566562967994039712273449902621266178545958",
"1"
],
"vk_beta_2": [
[
"6375614351688725206403948262868962793625744043794305715222011528459656738731",
"4252822878758300859123897981450591353533073413197771768651442665752259397132"
],
[
"10505242626370262277552901082094356697409835680220590971873171140371331206856",
"21847035105528745403288232691147584728191162732299865338377159692350059136679"
],
[
"1",
"0"
]
],
"vk_gamma_2": [
[
"10857046999023057135944570762232829481370756359578518086990519993285655852781",
"11559732032986387107991004021392285783925812861821192530917403151452391805634"
],
[
"8495653923123431417604973247489272438418190587263600148770280649306958101930",
"4082367875863433681332203403145435568316851327593401208105741076214120093531"
],
[
"1",
"0"
]
],
"vk_delta_2": [
[
"1747014100310549185786267801742033865627943574729348577592584345594030059513",
"16711809229852947806112024364434572651070644366787595318945698594033698101166"
],
[
"7959627701669666787676714778866583924558661647097841159638803895395285779619",
"5745710440443182690267071684942290668945011932415467031714706685148557703570"
],
[
"1",
"0"
]
],
"vk_alphabeta_12": [
[
[
"2029413683389138792403550203267699914886160938906632433982220835551125967885",
"21072700047562757817161031222997517981543347628379360635925549008442030252106"
],
[
"5940354580057074848093997050200682056184807770593307860589430076672439820312",
"12156638873931618554171829126792193045421052652279363021382169897324752428276"
],
[
"7898200236362823042373859371574133993780991612861777490112507062703164551277",
"7074218545237549455313236346927434013100842096812539264420499035217050630853"
]
],
[
[
"7077479683546002997211712695946002074877511277312570035766170199895071832130",
"10093483419865920389913245021038182291233451549023025229112148274109565435465"
],
[
"4595479056700221319381530156280926371456704509942304414423590385166031118820",
"19831328484489333784475432780421641293929726139240675179672856274388269393268"
],
[
"11934129596455521040620786944827826205713621633706285934057045369193958244500",
"8037395052364110730298837004334506829870972346962140206007064471173334027475"
]
]
],
"IC": [
[
"7208961304015467505974244928798294369663146566375946727480874978378963231594",
"21614551618839849099527790288527978962977478454444004954197553865077104731641",
"1"
],
[
"20307339771029451491474674032727372515507048888836318967504414849042064633937",
"9401931764668861050170218745300289496263152524845401471688659460238598401815",
"1"
]
]
}

View File

@ -0,0 +1,8 @@
[
"1",
"30",
"2",
"3",
"5",
"6"
]

View File

@ -0,0 +1 @@
{"a": "2","b": "3","c": "5"}

View File

@ -0,0 +1,14 @@
pragma circom 2.1.6;
template Multiply() {
signal input a;
signal input b;
signal input c;
signal s1;
signal output out;
s1 <== a * b;
out <== s1 * c;
}
component main = Multiply();

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.