You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to libsnark
Hi Fanghao,
I just updated the code at https://github.com/mariogemoll/libsnark-tutorial/tree/sha256 , it should work now. It wasn't too far off actually but a few bits were wrong/missing. Some things to note: - The number of public inputs is set explicitly through pb.set_input_sizes(num_public_inputs). - In the original code the correct number of public inputs would have been 256 (the number of bits in the hash). That would have resulted in a very costly verification (I tried a bit but didn't get it to run on Ethereum). However what one can do is make all the bit inputs private and add two public inputs which are their representation as two 128 bit numbers (because of the size of the underlying field they need to be split into two 128 bit values). The "multipacking" gadget adds the constraints that these numbers match the hash bits in the private inputs.