Hello,
I try to perform calculations in GF(2^3); e.g. calculate (x^2+x)(x+1) = x^3 + 2x^2 + x = x^3 + x as polynomial coefficients are modulo-2. Using the irreducible polynomial x^3 + x + 1 I arrive at (x^2+x)(x+1) = 1.
I try to do the same in sympy
import sympy as sym
import sympy.polys as polys
import sympy.polys.galoistools as gft
F = polys.domains.FF(2)
# x^2 + x
a = [1, 1, 0]
# x + 1
b = [1, 1]
res = gft.gf_mul(a, b, 8, F)
sym.pprint(res)
but arrive at [1 mod 2, 0 mod 2, 1 mod 2, 0 mod 2] which I interpret as x^3 + x. So it seems that the reduction using the irreducible polynomial is not done - is there a way to do this last step in sympy?
Thanks & regards - Clemens