Given $m^2\bmod A$ and $m^2\bmod B$, how do you find $m^2 \bmod AB$?
I'm 99% sure this is an application of the Chinese remainder theorem, although my workings do not quite show how it can be done.
You may of course assume $A$ and $B$ are coprime and that $m < A$.