This page links to six demonstrations of the Tonelli-Shanks modular square root algorithm applied to prime factorizations over Z[i], Z[w], and Z[2i].
First, this is an excerpt from Henri Cohen's A Course in Computational Algebraic Number Theory, Springer-Verlag, 1993, that explains the Tonelli-Shanks algorithm and the Algorithm of Cornacchia: