On the Inversion Modulo a Power of an Integer

📅 2025-06-03
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This paper addresses the efficient computation of multiplicative modular inverses $a^{-1} mod n^k$ for arbitrary integer moduli $n^k$ ($n>1$), overcoming the classical limitation that restricts existing algorithms to prime moduli. We propose the first general-purpose modular inversion algorithm for arbitrary base $n$, combining $p$-adic expansion with exact linear equation solving. The method relies solely on bit shifts, additions, and hardware-friendly built-in arithmetic operations, eliminating all division and modular reduction steps. It is naturally suited to large-word architectures (e.g., $n = 2^{64}$), achieving both theoretical generality and practical efficiency. Experimental evaluation demonstrates substantial speedup over the classic Koc algorithm—particularly pronounced for large word sizes—while maintaining correctness and numerical stability. Additionally, we provide a novel, rigorous proof of correctness for the Koc algorithm.

Technology Category

Application Category

📝 Abstract
Recently, Koc proposed a neat and efficient algorithm for computing $x = a^{-1} pmod {p^k}$ for a prime $p$ based on the exact solution of linear equations using $p$-adic expansions. The algorithm requires only addition and right shift per step. In this paper, we design an algorithm that computes $x = a^{-1} pmod {n^k}$ for any integer $n>1$. The algorithm has a motivation from the schoolbook multiplication and achieves both efficiency and generality. The greater flexibility of our algorithm is explored by utilizing the build-in arithmetic of computer architecture, e.g., $n=2^{64}$, and experimental results show significant improvements. This paper also contains some results on modular inverse based on an alternative proof of correctness of Koc algorithm.
Problem

Research questions and friction points this paper is trying to address.

Computing modular inverse for any integer n>1
Improving efficiency using computer arithmetic
Extending Koc's algorithm to general cases
Innovation

Methods, ideas, or system contributions that make the work stand out.

Computes modular inverse for any integer n
Uses built-in computer arithmetic efficiently
Improves speed with right shift operations
🔎 Similar Papers
No similar papers found.
Guangwu Xu
Guangwu Xu
Shandong University
cryptographyalgorithmscompressed sensingcomputational number theory
Y
Yunxiao Tian
SCST, Shandong University, China
B
Bingxin Yang
SCST, Shandong University, China