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

Update Pedersen::hash_buffer once we have implemented Poseidon #2796

Open
zac-williamson opened this issue Oct 11, 2023 · 1 comment
Open
Labels
C-barretenberg Component: barretenberg cryptography library crypto cryptography

Comments

@zac-williamson
Copy link
Contributor

The current pedersen::hash_buffer method, which hashes a buffer of bytes is non-canonical. It splits the bytes into 31-byte field elements and then performs a pairwise hash.

i.e. we compute H(elements[0], H(elements[1], ..., H(elements[n-1]))) instead of H(elements[0], elements[1], ..., elements[n-1])

We do this in order to keep the UltraPlonk recursive verificaion circuit under 2^19 constraints (pairwise Pedersen hashes are very efficient due to using Plookup tables. Larger hashes cannot as we cannot spare the table space for more than 2 generators).

Once Poseidon is implemented, it should be more efficient than Pedersen when hashing large amounts of data. We can therefore replace current uses with Poseidon, and make pedersen::hash_buffer's behavior more canonical, or potentially remove it altogether.

@zac-williamson zac-williamson added C-barretenberg Component: barretenberg cryptography library crypto cryptography labels Oct 11, 2023
@github-project-automation github-project-automation bot moved this to Todo in A3 Oct 11, 2023
@kevaundray
Copy link
Contributor

kevaundray commented Oct 29, 2023

Related to this comment in the pedersen cleanup issue -- Update: This is roughly still the case after the pedersen refactor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-barretenberg Component: barretenberg cryptography library crypto cryptography
Projects
Status: Todo
Development

No branches or pull requests

3 participants