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(integer): StaticSignedBigInt right shift #588

Merged
merged 1 commit into from
Sep 27, 2023
Merged

Conversation

tmontaigu
Copy link
Contributor

Check-list:

  • Tests for the changes have been added (for bug fixes / features)

@cla-bot cla-bot bot added the cla-signed label Sep 27, 2023
@github-actions
Copy link

@slab-ci cpu_fast_test

Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

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

Can you quickly indicate what wrong value we were getting before ?

@github-actions
Copy link

Pull Request has been approved 🎉
Launching full test suite...
@slab-ci cpu_test
@slab-ci cpu_integer_test
@slab-ci cpu_multi_bit_test
@slab-ci cpu_wasm_test
@slab-ci csprng_randomness_testing

@tmontaigu
Copy link
Contributor Author

tmontaigu commented Sep 27, 2023

For i256::MIN >> 1 we were getting [0, 0, 0, u64::MAX], so 64 1 in the MSB then zeros
when we expect 2 1 in MSB and the rest to be zero

@IceTDrinker
Copy link
Member

ok arithmetic shift

@tmontaigu
Copy link
Contributor Author

tmontaigu commented Sep 27, 2023

Yes but we were putting the value of the sign bit all over the most significant block and instead of only in places where sign bits would actually need to be used as padding

@tmontaigu tmontaigu merged commit a470b26 into main Sep 27, 2023
21 checks passed
@tmontaigu tmontaigu deleted the fix-signed-big-int-shr branch September 27, 2023 16:37
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.

2 participants