Efficient setup for a Montgomery multiplication@fgrieu: You are miscounting. Montgomery does not replace a single division by O(b**2) multiplies, it replaces all the divisions those multiplies. But asymptotic analysis miss the point because the asymptotics are the same for both algorithms. Montgomery trades a division for a multiplies, adds, and a right shift. Actual experiments for most processors and implementations seem to show the Montgomery is a big win against the naive algorithm.