And to be more synthetic, refer to this document:
"Factoring Polynomials with Rational Coefficients" by A K Lenstra, H W Lenstra, Jr & Lovasz.
https://typeset.io/pdf/factoring-polynomials-with-rational-coefficients-4jcm2kwak4.pdf nostr:note1x2r8qcevt8ykur6rzugl57wwncj75ew2wlmdguw06cpnl6qr8flscgwtlq