Skip to content

Improve performance of Monty pow/pow_vartime#1222

Merged
tarcieri merged 1 commit intoRustCrypto:masterfrom
andrewwhitehead:fix/pow-ref
Mar 9, 2026
Merged

Improve performance of Monty pow/pow_vartime#1222
tarcieri merged 1 commit intoRustCrypto:masterfrom
andrewwhitehead:fix/pow-ref

Conversation

@andrewwhitehead
Copy link
Contributor

@andrewwhitehead andrewwhitehead commented Mar 9, 2026

This is mostly a simple change to access the elements of powers_and_exponents by reference, which improves performance by 2-3% in my tests.

The constant WINDOW_COUNT is added to resolve an error displayed by rust-analyzer due to (I assume) the equality of evaluated constants not being guaranteed.

Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.96%. Comparing base (3c38f48) to head (15aaf0e).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1222   +/-   ##
=======================================
  Coverage   87.96%   87.96%           
=======================================
  Files         184      184           
  Lines       21172    21172           
=======================================
  Hits        18624    18624           
  Misses       2548     2548           

☔ View full report in Codecov by Sentry.
📢 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.

@andrewwhitehead
Copy link
Contributor Author

It also looks like primefield might benefit from using this pow_vartime for performance

@tarcieri tarcieri merged commit ac719ef into RustCrypto:master Mar 9, 2026
31 checks passed
@andrewwhitehead andrewwhitehead deleted the fix/pow-ref branch March 9, 2026 18: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.

2 participants