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 49fead2197 New Multiplication Gate reduction algorithm! 5 years ago
bn128 Preparing Pull Request 5 years ago
circuitcompiler New Multiplication Gate reduction algorithm! 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 New Multiplication Gate reduction algorithm! 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 1 0 0 0 0 0 0 0] [0 0 0 0 1 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 0 0 0 0 1 0 0] [0 0 0 0 0 0 0 1 0 0] [1 0 0 0 0 0 0 0 0 0]]
[[0 0 1 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 1 0 0 0 0 0 0 0 0] [0 1 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 1 0] [0 0 0 0 0 0 9724050000 0 1 9724050000]]
[[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 1 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 1] [0 0 0 1 0 0 0 0 0 0]]
input
[7 11]
witness
[1 7 11 1729500084900343 121 1331 161051 49 343 16807]
another input
[365235 11876525]
witness
[1 365235 11876525 2297704271284150716235246193843898764109352875 141051846075625 1675205776213312203125 236290867291438012851239954111328125 133396605225 48721109109352875 6499230557984496821593771875]

Note that we only need 7 multiplication Gates instead of 16. The 4th witness value is the programs output. Use python script to check correctness!