Usage of --verify

May 1, 2014 at 7:11 PM
Hi everyone

Can anybody advise about the usage of the --verify option? I am able to successfully use --genkeys and --dowork like so:
pinocchio-v0.4.exe --qap --dv --file circuit.arith --mem 4 --input input.txt --output output.txt --keys key --genkeys
and same thing with --dowork, but --verify causes a segfault (the same happens with either --pv or --dv). I am thinking perhaps it might be due to wrong parameters, since for example omitting --mem also causes a segault, for all operations.

May 5, 2014 at 10:44 PM
If you have a small circuit file and the commands you're using, I can give it a try on my side. I should warn you though that, as it mentions in the README file, the --genkeys, --dowork, and --verify flags have received very light testing, so it's quite possible bugs still lurk there.
May 6, 2014 at 7:53 AM
Thanks for the answer. It happens with every circuit I've tried, but here's a small example (example circuit from the paper):

Circuit example.c.arith
total 10
input 0                                  # input
input 1                                  # input
input 2                                  # input
input 3                                  # input
input 4                                  # one-input
const-mul-0 in 1 <4> out 1 <5>           # zero
add in 2 <0 1> out 1 <6>                 # ArithBusReq.AddReq(DFG.Input,DFG.Input)
mul in 2 <6 2> out 1 <7>                 # multiply
mul in 2 <7 3> out 1 <8>                 # multiply
mul in 2 <4 8> out 1 <9>                 # output-cast
output 9         
and the input file example.input.txt
0 1
1 2
2 3
3 4
4 1
I run it like so:
pinocchio-v0.4.exe --qap --pv --file example.c.arith --mem 4 --input example.input.txt --output example.output.txt --keys examplekey --genkeys
This correctly generates the keys. Then running the same command with --dowork instead of --genkeys correctly generates the proof and output file, and running it with --verify instead of --genkeys segfaults. It is indeed probably a bug, just wanted to make sure I was not overlooking something.
May 12, 2014 at 5:44 PM
There was a bug in the way --verify was handling the IO. It should be fixed in the latest version (fdf7c4fcf2b3). Sorry, this interface to the code hasn't received much attention.
May 13, 2014 at 7:36 AM
Works like a charm. Thanks!
Dec 10, 2016 at 8:02 PM

I am also trying to run the code that is discussed here. I am working in Ubuntu and I run the following command:
./pinocchio-v0.4.exe --qap --pv --file example.c.arith --mem 4 --input example.input.txt --output example.output.txt --keys examplekey --genkeys

However, I receive the following error:
bash: ./pinocchio-v0.4.exe: cannot execute binary file: Exec format error

How can I solve this error?