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

[Feature] Array variable indexing. #28388

Open
d0cd opened this issue Oct 9, 2024 · 0 comments
Open

[Feature] Array variable indexing. #28388

d0cd opened this issue Oct 9, 2024 · 0 comments
Labels
feature A new feature.

Comments

@d0cd
Copy link
Collaborator

d0cd commented Oct 9, 2024

🚀 Feature

Array indexing is restricted to constant u32s.
However given that arrays are fixed in size, it would be straightforward to implement array indexing by generating a sufficiently constrained circuit via an appropriate sequence of instructions.
The instructions should:

  • check that the index is in bounds.
  • mux the correct element of the array.

If this were to be implemented in snarkVM via an ARC, the Leo compiler could easily swap to the native version.

@d0cd d0cd added the feature A new feature. label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature.
Projects
None yet
Development

No branches or pull requests

1 participant