Shanks' square forms factorization