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(modexp): remove leading zeros when factoring modulus #760

Merged
merged 1 commit into from
May 12, 2023

Conversation

birchmd
Copy link
Member

@birchmd birchmd commented May 11, 2023

Description

There was a small bug in the new modexp implementation where sometimes factoring an even modulus into and odd number times a power of two left a leading zero on the odd number. This threw off some of the other parts of the algorithm, leading to incorrect results. This PR fixes the issue and adds test cases for it.

@birchmd birchmd added C-bug Category: Something isn't working. P-high Pririoty: high A-precompiles Area: Issues that relate to the precompiles. labels May 11, 2023
@birchmd birchmd requested a review from aleksuss May 11, 2023 21:22
@birchmd birchmd requested a review from joshuajbouw as a code owner May 11, 2023 21:22
@joshuajbouw joshuajbouw added this pull request to the merge queue May 12, 2023
Merged via the queue into develop with commit d6b1399 May 12, 2023
@joshuajbouw joshuajbouw deleted the fix/birchmd/modexp-bug branch May 12, 2023 10:46
joshuajbouw pushed a commit that referenced this pull request May 12, 2023
## Description

There was a small bug in the new modexp implementation where sometimes
factoring an even modulus into and odd number times a power of two left
a leading zero on the odd number. This threw off some of the other parts
of the algorithm, leading to incorrect results. This PR fixes the issue
and adds test cases for it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-precompiles Area: Issues that relate to the precompiles. C-bug Category: Something isn't working. P-high Pririoty: high
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants