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

bigint/rsa: Avoid constructing Montgomery constant for d. #2165

Merged
merged 1 commit into from
Dec 5, 2024
Merged

Conversation

briansmith
Copy link
Owner

We never multiply modulo d so avoid constructing n0 for it. Although n0 is almost free to construct now, that might change in the future. Also it is better to minimize the amount of processing on the secret value.

git difftool HEAD^1:src/arithmetic/bigint/modulus.rs src/arithmetic/bigint/modulusvalue.rs

@briansmith briansmith self-assigned this Dec 5, 2024
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

Attention: Patch coverage is 84.74576% with 9 lines in your changes missing coverage. Please review.

Project coverage is 96.95%. Comparing base (224bd7d) to head (46aeb2b).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/arithmetic/bigint/modulusvalue.rs 76.92% 2 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2165      +/-   ##
==========================================
+ Coverage   96.94%   96.95%   +0.01%     
==========================================
  Files         151      152       +1     
  Lines       20043    20057      +14     
  Branches      467      467              
==========================================
+ Hits        19430    19446      +16     
  Misses        505      505              
+ Partials      108      106       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

We never multiply modulo `d` so avoid constructing `n0` for it.
Although `n0` is almost free to construct now, that might change in the
future. Also it is better to minimize the amount of processing on the
secret value.

```
git difftool HEAD^1:src/arithmetic/bigint/modulus.rs src/arithmetic/bigint/modulusvalue.rs
```
@briansmith briansmith merged commit 45ff856 into main Dec 5, 2024
157 of 158 checks passed
@briansmith briansmith deleted the b/mont branch December 5, 2024 23:44
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.

1 participant