Residue Number System Comparison revisited, a software perspective
This work addresses the long-standing challenge of general integer comparison in residue number systems (RNS) by proposing an efficient method based on the introduction of an auxiliary modulus and a single mixed-radix conversion. The approach is applicable to arbitrary RNS moduli sets without imposing restrictions on the input range, thereby overcoming limitations inherent in existing techniques that require specific modulus forms or bounded dynamic ranges. The algorithm achieves a time complexity of O(n²), which can be parallelized to O(log n), significantly outperforming both classical and recent state-of-the-art methods constrained by such assumptions. This advancement provides a novel and practical solution to a critical bottleneck in RNS-based applications, including division, scaling, and cryptographic operations.