English

An Efficient Algorithm for Modulus Operation and Its Hardware Implementation in Prime Number Calculation

Cryptography and Security 2025-01-10 v2 Hardware Architecture

Abstract

This paper presents a novel algorithm for the modulus operation for FPGA implementation. The proposed algorithm use only addition, subtraction, logical, and bit shift operations, avoiding the complexities and hardware costs associated with multiplication and division. It demonstrates consistent performance across operand sizes ranging from 32-bit to 2048-bit, addressing scalability challenges in cryptographic applications. Implemented in Verilog HDL and tested on a Xilinx Zynq-7000 family FPGA, the algorithm shows a predictable linear scaling of cycle count with bit length difference (BLD), described by the equation y=2x+2y=2x+2, where yy represents the cycle count and xx represents the BLD. The application of this algorithm in prime number calculation up to 500,000 shows its practical utility and performance advantages. Comprehensive evaluations reveal efficient resource utilization, robust timing performance, and effective power management, making it suitable for high-performance and resource-constrained platforms. The results indicate that the proposed algorithm significantly improves the efficiency of modular arithmetic operations, with potential implications for cryptographic protocols and secure computing.

Keywords

Cite

@article{arxiv.2407.12541,
  title  = {An Efficient Algorithm for Modulus Operation and Its Hardware Implementation in Prime Number Calculation},
  author = {W. A. Susantha Wijesinghe},
  journal= {arXiv preprint arXiv:2407.12541},
  year   = {2025}
}
R2 v1 2026-06-28T17:44:25.213Z