arnaucube / go-snark-study

zkSNARK library implementation in Go from scratch (compiler, setup, prover, verifier)
GNU General Public License v3.0
255 stars 58 forks source link

Why minus operation goes wrong? #18

Closed ljz0775 closed 4 years ago

ljz0775 commented 4 years ago

testing go-snark-cli,I have given a private input '5', a public input '7', and my testing circuit like:

func main(private s0,public s1): s3 = s0 3 s4 = s3 - 8 <--------- Minus Is Here equals(s4,s1) out=1 1

but when i compile the circuit, always an panic error deter me: "px!=hz*zx" ??? (meantime the witness is [1,7,5,15,7,1])

do 5 * 3 - 8 ≠ 7 ???