You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: