I have very large integers $m$, where ( $\log_2(m)> 630$), and I need to find square roots modulo m. I am aware of several theorems that allow me to find the roots $\mod m$ when m is a power of a prime, or can be factored into a product of powers of primes. Those theorems are applied, the roots are found for each prime tower $p_i^k$ of $m$ and then the Chinese Remainder Theorem is applied and voila, done.
But, some of my $m's$ don't factor even after a few minutes, and they all test negative for primality. I am using sympy and gmpy2 in python to do all this.
How can I find $x$ when I know $a$ and $m$ in $$x^2 \equiv a \mod m$$ but can't factor $m$?
Anything beyond trial and error in randomly selecting $x$ and then checking helps.