docs: def _gffastdivmod(dividend, divisor):
          '''Fast polynomial division by using Extended Synthetic Division and optimized for GF(2^p) computations (so it is not generic, must be used with GF2int).
          Transposed from the reedsolomon library: https://github.com/tomerfiliba/reedsolomon
          BEWARE: it works only for monic divisor polynomial! (which is always the case with Reed-Solomon's generator polynomials)'''
  
          msg_out = list(dividend) # Copy the dividend list and pad with 0 where the ecc bytes will be computed
          for i in _range(len(dividend)-(len(divisor)-1)):
              coef = msg_out[i] # precaching
              if coef != 0: # log(0) is undefined, so we need to avoid that case explicitly (and it's also a good optimization)
                  for j in _range(1, len(divisor)): # in synthetic division, we always skip the first coefficient of the divisior, because it's only used to normalize the dividend coefficient (which is here useless since the divisor, the generator polynomial, is always monic)
                      #if divisor[j] != 0: # log(0) is undefined so we need to check that, but it slow things down in fact and it's useless in our case (reed-solomon encoding) since we know that all coefficients in the generator are not 0
                      msg_out[i + j] ^= divisor[j] * coef # equivalent to the more mathematically correct (but xoring directly is faster): msg_out[i + j] += -divisor[j] * coef
                      # Note: we could speed things up a bit if we could inline the table lookups, but the Polynomial class is generic, it doesn't know anything about the underlying fields and their operators. Good OOP design, bad for performances in Python because of function calls and the optimizations we can't do (such as precomputing gf_exp[divisor]). That's what is done in reedsolo lib, this is one of the reasons it is faster.
  
          # The resulting msg_out contains both the quotient and the remainder, the remainder being the size of the divisor (the remainder has necessarily the same degree as the divisor -- not length but degree == length-1 -- since it's what we couldn't divide from the dividend), so we compute the index where this separation is, and return the quotient and remainder.
          separator = -(len(divisor)-1)
          return Polynomial(msg_out[:separator]), Polynomial(msg_out[separator:])