Minor performance tweak: use Barrett reduction rather than Montgomery.