privacy-scaling-explorations / poseidon-gadget

Poseidon gadget for Halo2, previously at halo2_gadgets.
Apache License 2.0
2 stars 2 forks source link

why is poseidon::primitives::permute private? #3

Open themighty1 opened 3 weeks ago

themighty1 commented 3 weeks ago

Hi, in our project we would like to create a PermuteCircuit like the one shown here https://github.com/privacy-scaling-explorations/poseidon-gadget/blob/764a682ee448bfbde0cc92a04d241fe738ba2d14/src/poseidon/pow5.rs#L605

However, unlike in your test here https://github.com/privacy-scaling-explorations/poseidon-gadget/blob/764a682ee448bfbde0cc92a04d241fe738ba2d14/src/poseidon/pow5.rs#L676 , we wouldn't be able to access poseidon::primitives::permute to compute the permutation in the clear since the method is private.

Would you consider making that method public? Or is it private on purpose?

davidnevadoc commented 2 weeks ago

In this example, the permute primitive is computed to get a result against which to check the computation of the gadeget. https://github.com/privacy-scaling-explorations/poseidon-gadget/blob/764a682ee448bfbde0cc92a04d241fe738ba2d14/src/poseidon/pow5.rs#L676 Do you need to compute the permutation independently, outside of the circuit? :thinking: @themighty1

themighty1 commented 2 weeks ago

Do you need to compute the permutation independently, outside of the circuit?

yes, that's what we need it for @davidnevadoc

davidnevadoc commented 2 weeks ago

I imagine it was set to private because as the intention was to expose only the full hash. Having said this, I think is fine to make it pub.

This has been changed in #5, is there any other primitive that you need exposed? @themighty1