Skip to Main Content
Modular arithmetic is becoming an area of major importance for many modern applications; RNS is widely used in digital signal processing, and most public-key cryptographic algorithms require very fast modular multiplication, and exponentiation. When such an arithmetic is required, specific values such as Fermat or Mersenne numbers are often chosen since they allow for very efficient implementations. However, there are cases where only very few of those numbers are available. We present an algorithm for the Euclidean division with remainder and we give the classes of divisors for which our algorithm is particularly efficient compared to commonly used method.