Given two not necessarily monic polynomials in $\mathbb{Z}[X]$, how does one find their GCD in $\mathbb{Z}[X]$? I need to know in order to implement Yun's algorithm for square-free polynomial factorization, so presumably doing it by factoring the polynomials would defeat the purpose. I don't see how to use the Euclidean algorithm without getting coefficients outside of $\mathbb{Z}$ since $\mathbb{Z}$ isn't a field.
Maybe something like using the Euclidean algorithm over $\mathbb{Q}[X]$, then multiplying the result by the LCM of the denominators of the coefficients, and trying out different integer multiples of that?
To be more concrete about my questioning musing in the original post: if an integer can be factored out of the GCD of two polynomials, then that integer can also be factored out of those two polynomials, so the polynomial GCD takes the form of a polynomial whose coefficients are comprime times the GCD, $a$, of the coefficients of the original two polynomials, collectively. Therefore, it should suffice to apply the Euclidean algorithm over $\mathbb{Q}[X]$, then multiply away any coefficient denominators, then divide away any common integer factor of the coefficients, and finally multiply by $a$.