Performance optimisation, only calculate residue if modulus has changed
Performance optimisation, only calculate residue if modulus has changed

PeterMagnusson/modexp,PeterMagnusson/modexp,PeterMagnusson/modexp,PeterMagnusson/modexp