Closed mimoo closed 2 years ago
The first issue seems to be that the private input indeed is used prior to poseidon:
let x = private_input[0] + private_input[1];
assert_eq(x, 2);
let digest = crypto::poseidon(private_input);
so the wiring is correct, but threw me off (it could have displayed the line where private_input is created for the first time, but it would have been confusing for someone who does not know the internals, so I think it is probably fine this way...
For the second issue, the problem was that the wiring of the zero wasn't next to these wiring, but it was there!
7: let digest = crypto::poseidon(private_input);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7: let digest = crypto::poseidon(private_input);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(4,0) -> (5,2)
I'm glad that there was no bug : ) and that the debugging is such a useful way to dig into the output
in
example.no
we see the following wiring:shows that a zero constant is being created via gate number 4 to serve as the capacity of the sponge:
and then the private input is wired to the sponge's input:
this should not happen. There are two issues:
(1,0)
should be wired to(5,2)
)