Skip to content

Fix Montgomery reduction in repeated squaring - #1344

Merged
tarcieri merged 4 commits into
masterfrom
fixed-monty-form/issue-1343-pow-test
Oct 6, 2026
Merged

tarcieri merged 4 commits into
masterfrom
fixed-monty-form/issue-1343-pow-test

Conversation

@tarcieri

@tarcieri tarcieri commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

Ensures each intermediate square is fully reduced using a carry-aware conditional subtraction, preserving the invariant that inputs remain below the modulus.

Additionally adds a regression test.

Closes #1343

@tarcieri
tarcieri force-pushed the fixed-monty-form/issue-1343-pow-test branch from 9579434 to 04038c9 Compare September 11, 2026 20:17
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
@codecov

codecov Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.05%. Comparing base (898b6cf) to head (0113271).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1344      +/-   ##
==========================================
- Coverage   91.06%   91.05%   -0.01%     
==========================================
  Files         189      189              
  Lines       22645    22621      -24     
==========================================
- Hits        20622    20598      -24     
  Misses       2023     2023              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tarcieri

Copy link
Copy Markdown
Member Author

@andrewwhitehead would you mind opening a separate PR with the fix? Feel free to reuse my test if you'd like

@tarcieri tarcieri changed the title [WIP] FixedMontyForm::pow(_vartime) regression test for #1343 Fix Montgomery reduction in repeated squaring Oct 6, 2026
@tarcieri
tarcieri marked this pull request as ready for review October 6, 2026 17:04
@tarcieri
tarcieri force-pushed the fixed-monty-form/issue-1343-pow-test branch from e0b4c96 to 0113271 Compare October 6, 2026 17:13
@tarcieri
tarcieri merged commit 1ab28f6 into master Oct 6, 2026
32 checks passed
@tarcieri
tarcieri deleted the fixed-monty-form/issue-1343-pow-test branch October 6, 2026 17:27
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.

pow proptest failure

2 participants