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

Simplify compress_elements #2155

Draft
wants to merge 2 commits into
base: testnet3
Choose a base branch
from

Conversation

ljedrz
Copy link
Collaborator

@ljedrz ljedrz commented Nov 6, 2023

This PR is a suggestion for further investigation, so I'm filing it as a draft. It builds on https://github.com/AleoHQ/snarkVM/pull/2150 with the final commit being new.

In compress_elements, which only ever gets called from push_elements_to_sponge, the second tuple members (first.1 and second.1) are always F::one, which means that:

  • we don't need to pass tuples from push_elements_to_sponge (only limbs)
  • the overhead calculation only needs to be performed once

This is not a viable approach if we want compress_elements to be callable from outside of push_elements_to_sponge etc, but if this is not expected, it would be a simple win for perf and clarity.

@ljedrz ljedrz changed the title Simplify compress elements Simplify compress_elements Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants