You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
mottla 345063d132 dont mix input output 5 years ago
bn128 Preparing Pull Request 5 years ago
circuitcompiler dont mix input output 5 years ago
cli Preparing Pull Request 5 years ago
fields cli 5 years ago
r1csqap changed signal order : [1,inputs..,outputs...,trace...] 5 years ago
r1csqapFloat doing trusted setup 6 years ago
.gitignore update cli, update readme 5 years ago
LICENSE Initial commit 6 years ago
README.md Preparing Pull Request 5 years ago
build-cli.sh update cli, update readme 5 years ago
go-snark-cli update cli, update readme 5 years ago
go.mod cli 5 years ago
go.sum cli 5 years ago
snark.go dont mix input output 5 years ago
snark_test.go dont mix input output 5 years ago

README.md

Caution, Warning

Fork UNDER CONSTRUCTION! Will ask for merge soon

Current implementation status:

Library usage

Warning: not finished.

Working example of gate-reduction and code parsing:

def do(x):
    e = x * 5
    b = e * 6
    c = b * 7
    f = c * 1
    d = c * f
    out = d * mul(d,e)

def doSomethingElse(x ,k):
    z = k * x
    out = do(x) + mul(x,z)

def main(x,z):
    out = do(z) + doSomethingElse(x,x)

def mul(a,b):
    out = a * b

R1CS Output:

[[0 0 210 0 0 0 0 0 0 0 0 0] [0 0 0 1 0 0 0 0 0 0 0 0] [0 0 0 1 0 0 0 0 0 0 0 0] [0 210 0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 1 0 0 0 0 0] [0 0 0 0 0 0 1 0 0 0 0 0] [0 1 0 0 0 0 0 0 0 0 0 0] [0 1 0 0 0 0 0 0 0 0 0 0] [1 0 0 0 0 0 0 0 0 0 0 0]]
[[0 0 210 0 0 0 0 0 0 0 0 0] [0 0 5 0 0 0 0 0 0 0 0 0] [0 0 0 0 1 0 0 0 0 0 0 0] [0 210 0 0 0 0 0 0 0 0 0 0] [0 5 0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 1 0 0 0 0] [0 1 0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 1 0 0] [0 0 0 0 0 1 0 0 1 0 1 0]]
[[0 0 0   1 0 0 0 0 0 0 0 0] [0 0 0 0 1 0 0 0 0 0 0 0] [0 0 0 0 0 1 0 0 0 0 0 0] [0 0   0 0 0 0 1 0 0 0 0 0] [0 0 0 0 0 0 0 1 0 0 0 0] [0 0 0 0 0 0 0 0 1 0 0 0] [0 0 0 0 0 0 0 0 0 1 0 0] [0 0 0 0 0 0 0 0 0 0 1 0] [0 0 0 0 0 0 0 0 0 0 0 1]]
input
[7 11]
witness
[1 7 11 5336100 293485500 1566067976550000 2160900 75631500 163432108350000 49 343 1729500084900343]

Note that we only need 9 multiplication Gates instead of 16