chinese remainder theorem is a technique used to reduce calculations with large moduli to similar calculations for each of the (mutually co-prime) factors of the modulus a comprehensive explanation can be found at: https://en.wikipedia.org/wiki/Chinese_remainder_theorem#:~:text=The%20Chinese%20remainder%20theorem%20is,similar%20computations%20on%20small%20integers.