Montgomery form is a different way of expressing the elements of the ring in which modular products can be computed without expensive divisions. While divisions are still necessary, they can be done with respect to a different divisor R.
As an example for Montgomery reduction, we consider the product of two numbers x = 6 and y = 7 from Z 29 or the corresponding field G 29 of Gaussian integers with π = 5 + 2 i . The two integers x and y are mapped to the Gaussian integers X = x R mod π = 2 − i and Y = y R mod π = − 2 with R = 8 in the Montgomery domain.
Montgomery's reduction 9 is not efficient for a single modular multiplication, but can be used effectively in computations where many multiplications are performed for given inputs. Barrett's reduction 1 is applicable when many reductions are performed with a single modulus.
Differences: Montgomery reduction requires numbers to be converted into and out of “Montgomery form” (expensive operations that require a true modulo operation in each direction), whereas Barrett reduction operates on regular numbers directly.
The Montgomery equation (ME) assumes that leaf area (A) is a proportional function of the product of leaf length (L) and width (W), i.e., A = cLW, where c is called the Montgomery parameter.
Given two integer numbers z and m, Barrett's reduction algorithm computes the remainder r = z mod m, where z = qm + r in an efficient way.