Montgomery Reduction - Description of Algorithm

Description of Algorithm

The Montgomery reduction algorithm calculates as follows:

if return else return .

Note that only additions, subtractions, multiplications, and integer divides and modulos by R are used – all of which are 'cheap' operations.

To understand why this gives the right answer, consider the following:

  • . But by the definition of and, is a multiple of, so . Therefore, ; in other words, is exactly divisible by, so is an integer.
  • Furthermore, ; therefore, as required.
  • Assuming, (as ). Therefore the return value is always less than .

Therefore, we can say that

Using this method to calculate is generally less efficient than a naive multiplication and reduction, as the cost of conversions to and from residue representation (multiplications by and modulo ) outweigh the savings from the reduction step. The advantage of this method becomes apparent when dealing with a sequence of multiplications, as required for modular exponentiation (e.g. exponentiation by squaring).

Read more about this topic:  Montgomery Reduction

Famous quotes containing the words description of and/or description:

    A sound mind in a sound body, is a short, but full description of a happy state in this World: he that has these two, has little more to wish for; and he that wants either of them, will be little the better for anything else.
    John Locke (1632–1704)

    Whose are the truly labored sentences? From the weak and flimsy periods of the politician and literary man, we are glad to turn even to the description of work, the simple record of the month’s labor in the farmer’s almanac, to restore our tone and spirits.
    Henry David Thoreau (1817–1862)