Factoring Polynomials in Quadratic Form