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

Restricting SHR and SHL to be maximally shifted by a U8 #4841

Closed
IlyasRidhuan opened this issue Apr 18, 2024 · 0 comments · Fixed by #4907
Closed

Restricting SHR and SHL to be maximally shifted by a U8 #4841

IlyasRidhuan opened this issue Apr 18, 2024 · 0 comments · Fixed by #4907
Assignees
Labels
aztec.nr Helpful for development of Aztec.nr the smart contract framework enhancement New feature or request

Comments

@IlyasRidhuan
Copy link

Shifts are implemented for non-field values, i.e. numbers within the range [0, 2^128-1]. Shifting any of these number by greater than 128 bits trivially results in 0. We should be able to restrict the amount of bits a number can be shifted by to be within the range of U8.

@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Apr 18, 2024
@Savio-Sou Savio-Sou added enhancement New feature or request aztec.nr Helpful for development of Aztec.nr the smart contract framework labels Apr 22, 2024
@TomAFrench TomAFrench moved this from 📋 Backlog to 🏗 In progress in Noir Apr 25, 2024
github-merge-queue bot pushed a commit that referenced this issue Apr 26, 2024
# Description

## Problem\*

Resolves #4841

## Summary\*
bit shift now requires the number of bits to be u8.


## Additional Context



## Documentation\*

Check one:
- [ ] No documentation needed.
- [X] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [ ] I have tested the changes locally.
- [ ] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.

---------

Co-authored-by: Tom French <[email protected]>
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Noir Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aztec.nr Helpful for development of Aztec.nr the smart contract framework enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants