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

Support choosing generators for pedersen hashes #1341

Closed
1 task
sirasistant opened this issue May 12, 2023 · 1 comment
Closed
1 task

Support choosing generators for pedersen hashes #1341

sirasistant opened this issue May 12, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@sirasistant
Copy link
Contributor

Problem

To preserve collision resistance when hashing with pedersen data of different lengths, we need to be able to choose the set of generators to use for the hash. Right now we are using barretenberg's default generators (hash_index = 0) since we don't allow the user to customize which generators to use when calling pedersen.

This could lead of users being able to craft collisions when hashing sets of data of different domains (different lengths). By hashing data of a specific domain with specific generators, we can avoid cross-domain collisions.

An example of this usage is Aztec circuits:
https://github.com/AztecProtocol/aztec-packages/blob/master/circuits/cpp/src/aztec3/constants.hpp#L60

You can know more about this issue here

Proposed solution

Add a domain separator parameter to the Pedersen BlackBoxFunctionCall to pass to the backend, that will be used to select the generator set to use, allowing to hash data of diferent domains using pedersen.

Alternatives considered

No response

Additional context

No response

Submission Checklist

  • Once I hit submit, I will assign this issue to the Project Board with the appropriate tags.
@sirasistant sirasistant added the enhancement New feature or request label May 12, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir May 12, 2023
@kevaundray
Copy link
Contributor

This seems to now be supported, so closing issue

@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Jul 25, 2023
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
Archived in project
Development

No branches or pull requests

2 participants