How to decrypt Rabin message when p=q and you have the roots from Tonelli-Shanks
We are given $n&gt;4$ and ciphertext $c\in(0,n)$ for textbook Rabin encryption. We want to solve for $x\in[0,n)$ the equation $x^2\bmod n=c$.  We found that $n$ is a square, computed $p=\sqrt n$, found that it is prime, solved $y^2\bmod p=c\bmod p$ yielding two roots $y_0\in(0,p/2)$ and $y_1=p-y_0$, and now want the solutions for the original equation.
Every $x\in[0,n)$ can be uniquely written as $x=y+z\,p$ with $y\in[0,p)$ and $z\in[0,p)$.
If $x=y+z\,p$ is a solution of $x^2\equiv c\pmod{p^2}$, then that also yield modulo $p$ since $p$ divides $p^2$, thus $y^2\equiv c\pmod p$, thus our earlier work did yield the possible values of $y$.
Now $(y+z\,p)^2\equiv c\pmod{p^2}$ becomes $y^2+2\,y\,z\,p\equiv c\pmod{p^2}$, that is
$2\,y\,z\,p\equiv c-y^2\pmod{p^2}$, that is
$\exists k\in\mathbb Z,\,2\,y\,z\,p+k\,p^2=c-y^2$, that is
$\exists k\in\mathbb Z,\,2\,y\,z+k\,p=(c-y^2)/p$, that is
$c-y^2$ is divisible by $p$ and $2\,y\,z\equiv(c-y^2)/p\pmod p$, that is
$c-y^2$ is divisible by $p$ and $z\equiv(2\,y)^{-1}\,((c-y^2)/p)\pmod p$
Thus we check that $c-{y_0}^2\bmod p=0$ (which must hold unless we goofed in computing $y_0$),
compute $b_0=(c-{y_0}^2)/p\bmod p$, then $z_0=(2\,y_0)^{-1}\,b_0\bmod p$,
then $x_0=y_0+z_0\,p$, and that's one solution. It can't be zero. The other is $x_1=p^2-x_0$.