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:

    As they are not seen on their way down the streams, it is thought by fishermen that they never return, but waste away and die, clinging to rocks and stumps of trees for an indefinite period; a tragic feature in the scenery of the river bottoms worthy to be remembered with Shakespeare’s description of the sea-floor.
    Henry David Thoreau (1817–1862)

    I fancy it must be the quantity of animal food eaten by the English which renders their character insusceptible of civilisation. I suspect it is in their kitchens and not in their churches that their reformation must be worked, and that Missionaries of that description from [France] would avail more than those who should endeavor to tame them by precepts of religion or philosophy.
    Thomas Jefferson (1743–1826)