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

feat: add lookup table #388

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

feat: add lookup table #388

wants to merge 8 commits into from

Conversation

ivokub
Copy link
Collaborator

@ivokub ivokub commented Oct 25, 2022

Adds AS-Waksman permutation network (for internal use only for building gadgets).

We implement a simple append-only lookup table using it. We could probably also to a full RW memory possibly.

Thoughts:

  • right now we use simplified form of RAM, which requires switching also indices and prev-values. If the actual values are smaller (for example when switching the limbs of non-native elements), then we could pack everything into a single variable and use more efficient switching.
  • otherwise, if we would want to lookup from arrays, we can have more efficient switching if we consider the whole array at once.
  • it would be rally easy to extend this approach to proper RAM. Maybe should add now?
  • the entries do not have to be consecutively ordered. Right now we use curr_index-prev_index to indicate if we should compare against current or previous but could use IsZero(curr_index-prev_index). It is only one constraint more.

Actually, all these things seem to be something which could be provided as initialisation options. Maybe makes sense to implement that way?

@ivokub ivokub self-assigned this Oct 25, 2022
@ivokub ivokub added this to the v0.8.0 milestone Oct 25, 2022
@ivokub
Copy link
Collaborator Author

ivokub commented Oct 25, 2022

FYI @Tabaie, I updated the PR description about possible improvements.

@Tabaie
Copy link
Contributor

Tabaie commented Nov 14, 2022

Does this implement a particular paper?

@ivokub
Copy link
Collaborator Author

ivokub commented Nov 14, 2022

Does this implement a particular paper?

The AS Waksman routing network is described in On Arbitrary Waksman Networks and their Vulnerability by Beauquier and Darrot. It describes how to connect the gates in layers, the tricks for the lower gates and splitting to obtain the arbitrary-sizeness (compared to previous results where the number of inputs had to be power of two). It also describes bipartite coloring for deciding the routing.

@gbotrel gbotrel modified the milestones: v0.8.0, v0.9.0 Jan 13, 2023
@gbotrel gbotrel mentioned this pull request Feb 8, 2023
3 tasks
@ivokub ivokub mentioned this pull request Feb 17, 2023
Copy link
Contributor

@Tabaie Tabaie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the long delay!

@gbotrel gbotrel changed the base branch from develop to master August 22, 2023 19:48
@ivokub ivokub removed this from the v0.9.0 milestone Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants