zksecurity / noname

Noname: a programming language to write zkapps
https://zksecurity.github.io/noname/
178 stars 44 forks source link

wrong gate for public output in double generic mode #61

Open katat opened 4 months ago

katat commented 4 months ago

Currently the public output needs to be calculated at the end and assign to the first column of the witness rows. Each row represents a gate.

When it is single generic gate mode, the output assignment can be done properly in a row (gate) that is reserved for only that public output.

But in double generic gate mode, the gate contains the output wire fails to pass the constraint check.

mimoo commented 4 months ago

do you know what is happening here? add_public_output should not use the double generic gate optimization, maybe it does?

katat commented 4 months ago

oh yeah, it uses add_generic_gate. That is probably the cause.