def gf_gcd(f, g, p, K):
 while g:
  (f, g) = (g, gf_rem(f, g, p, K))
 return gf_monic(f, p, K)[1]

def gf_gcd ( f , g , p , K ) : while g : ( f , g ) = ( g , gf_rem ( f , g , p , K ) ) return gf_monic ( f , p , K ) [ 1 ]
euclidean algorithm in gf(p)[x] .