The mulmod command computes A*B modulo P efficiently. In the case of polynomials the fourth argument X specifies the variable and an optional fifth argument P specifies the modulus.
# integers mulmod(2,2,4); 0 # polynomials mulmod(x-1,x+1,x^2+x+1,x); -x-2 # polynomials mod p mulmod(x-1,x+1,x^2+x+1,x,11); 10*x+9