Montgomery reduction implementation
modified longmod subtraction requires less iterations