Given a number and a modulus with its factors I want to compute its 4 square roots.
So if the number is 177 and the modulus is 893 with factors 47 and 19.
With the help of the extended euclidean algorithm i can find $W_{19}=-94$ and $W_{47}=95$.
Because 47 and 19 are both one less than a multiple of four, I can use the following lemma: $x_1=a^{\frac{p+1}{4}}$ and $x_2=a^{\frac{p+1}{4}}$ where $x_1$ and $x_2$ are the square roots.
For 19 $a=177\equiv 6 \bmod 19$, so one of the roots will be $6^5=5 mod 19$.
And for 47 $a=177\equiv 36 \bmod 47$ and $36^{12}= 6 \bmod 47$.
So for example one of the roots is $w_{19}*5+w_{47}*6=100$ using the CRT.
Now my question is how to compute the square roots if the factors (say $p$ and $q$) are not $\equiv 3 \bmod 4$ eg $113$ and $157$ (edit: not $149$ my bad). Am I still able to use this algorithm with a little tweak or will I need a different approach?
Thank you in advance for your response.