Papers › An Elementary Method For Fast Modular Exponentiation With Factored Modulus

An Elementary Method For Fast Modular Exponentiation With Factored Modulus

19 Jan 2024arXiv:2401.10497links table onlyarchive 2025-07-28

Anay Aggarwal, Manu Isaacs

The archive published only this paper's code-link row. Authors, date and abstract are from arXiv's metadata (CC0), read from the Kaggle arXiv metadata snapshot of 2026-09-12 where its title matched the archive's; the title is the archive's.

We present a fast algorithm for modular exponentiation when the factorization of the modulus is known. Let a,n,m be positive integers and suppose m factors canonically as ∏ᵢ₌₁ᵏ pᵢ^(eᵢ). Choose integer parameters tᵢ∈[1, eᵢ] for 1≤i≤k. Then we can compute the modular exponentiation aⁿm in O(max(eᵢ/tᵢ)+∑ᵢ₌₁ᵏ tᵢlogpᵢ) steps (i.e., modular operations). We go on to analyze this algorithm mathematically and programmatically, showing significant asymptotic improvement in specific cases. Specifically, for an infinite family of m we achieve a complexity of O(√(logm)) steps, much faster than the Repeated Squaring Algorithm, which has complexity O(logm). Additionally, we extend our algorithm to matrices and hence general linear recurrences. The complexity is similar; with the same setup we can exponentiate matrices in GL_d(ℤ/mℤ) in less than O(max(eᵢ/tᵢ)+d²∑ᵢ₌₁ᵏ tᵢlogpᵢ) steps. This improves Fiduccia's algorithm and the results of Bostan and Mori in the case of ℤ/mℤ. We prove analogous results for ℤ/pᵏℤ ring extensions.

PaperPDFCode

Code

misaacs3737/modExp officialmentioned in papermentioned on GitHub report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

Not run by Syntology. Nothing on this page verifies that the listed code works.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections