Detailed Description

The Montgomery representation represents each congruence class [a] as a*r%n, where r is a convenient power of 2.

const Element& returned by member functions are references to internal data members. Since each object may have only one such data member for holding results, the following code will produce incorrect results: