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

Fix incorrect range reduction code in SWord shifts #127

Merged
merged 1 commit into from
Jun 4, 2021
Merged

Conversation

robdockins
Copy link
Contributor

When using the SWord module for dynamically-sized words, one has to
match the sizes of shift operations before passing them down to the
main representation code. When the shift amount has a larger bit-width
than the word to be shifted, a range reduction is required so the
truncation of the shift amount still gets the correct result. Previously,
this reduction was being done incorrectly by computing a max instead
of a min.

Fixes #126

When using the SWord module for dynamically-sized words, one has to
match the sizes of shift operations before passing them down to the
main representation code. When the shift amount has a larger bit-width
than the word to be shifted, a range reduction is required so the
truncation of the shift amount still gets the correct result. Previously,
this reduction was being done incorrectly by computing a `max` instead
of a `min`.

Fixes #126
@robdockins robdockins merged commit 42b6363 into master Jun 4, 2021
robdockins added a commit to GaloisInc/cryptol that referenced this pull request Jun 17, 2021
This bug was fixed in What4 via GaloisInc/what4#127
which was included in What4 version 1.2.

Fixes #1210
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.

SWord range reduction bug
1 participant