Integrated photonics modular arithmetic processor