Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add poseidon permutation opcode #4037

Closed
kevaundray opened this issue Jan 15, 2024 · 3 comments
Closed

Add poseidon permutation opcode #4037

kevaundray opened this issue Jan 15, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@kevaundray
Copy link
Contributor

Problem

Poseidon is a popular circuit friendly hash function, currently we do not have an efficient blackbox function for it like keccak, sha256 and blake.

Happy Case

Add the poseidon permutation opcode

Alternatives Considered

No response

Additional Context

It would be great if we could make the opcode agnostic to the t parameter, this does not seem possible and barretenberg uses a non-standard t parameter for efficiency.

Would be good to investigate whether we can add a more fine grained opcode without losing efficiency and still being agnostic to t

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@kevaundray kevaundray added the enhancement New feature or request label Jan 15, 2024
@kevaundray kevaundray added this to the 1.0 milestone Jan 15, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Jan 15, 2024
@guipublic
Copy link
Contributor

I don't see how we could be agnostic to t, unless we hide the state. But I think that if we want to do anything useful with the permutation, we would need to manipulate the state in Noir.
So I believe the opcode should expose the state, and this means its size t as well.

kevaundray pushed a commit to AztecProtocol/aztec-packages that referenced this issue Jan 25, 2024
Related to issue: noir-lang/noir#4037

The PR adds the opcode to ACIR and updates BB and Noir accordingly.
Furthermore you can use it via a foreign function in the stdlib. This
will generate the proper ACIR opcode but the solver will not be able to
solve it and BB will skip it.
AztecBot pushed a commit that referenced this issue Jan 25, 2024
Related to issue: #4037

The PR adds the opcode to ACIR and updates BB and Noir accordingly.
Furthermore you can use it via a foreign function in the stdlib. This
will generate the proper ACIR opcode but the solver will not be able to
solve it and BB will skip it.
AztecBot pushed a commit to AztecProtocol/barretenberg that referenced this issue Jan 26, 2024
Related to issue: noir-lang/noir#4037

The PR adds the opcode to ACIR and updates BB and Noir accordingly.
Furthermore you can use it via a foreign function in the stdlib. This
will generate the proper ACIR opcode but the solver will not be able to
solve it and BB will skip it.
michaelelliot pushed a commit to Swoir/noir_rs that referenced this issue Feb 28, 2024
Related to issue: noir-lang/noir#4037

The PR adds the opcode to ACIR and updates BB and Noir accordingly.
Furthermore you can use it via a foreign function in the stdlib. This
will generate the proper ACIR opcode but the solver will not be able to
solve it and BB will skip it.
@TomAFrench
Copy link
Member

@guipublic Do we really gain much on having the poseidon2 permutation added as a blackbox function rather than in Noir directly? As it's just arithmetic it seems like we'd get all the same benefits from AztecProtocol/aztec-packages#5374?

@guipublic
Copy link
Contributor

I think there is some gain as the gates are tailored to the specific Poseidon operations, i.e they are hand-made crafted as opposed to automatically generated in Noir.
Another point is that using a Honk backend will greatly benefit from the blackbox function, and I think having a Honk backend for Noir is something that we want.

n.b: the poseidon2 permutation is already added as a blackbox.

@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

3 participants