# Multiplicative order of elements in a finite field defined by QuotientRing

I've defined the AES's $\operatorname{GF}(2^8)$ field as follows;

R.<x> = PolynomialRing(GF(2), 'x')
S.<y> = QuotientRing(R, R.ideal(x^8+x^4+x^3+x+1))
S.is_field()


When I added the below and run it

print("y+1 = ",(y+1).multiplicative_order())


I've got this error;

   2671         if not self.is_unit():
-> 2672             raise ArithmeticError("self (=%s) must be a unit to have a multiplicative order.")

• How one can easily find the multiplicative order?

I've seen this question How to find the multiplicative order of an element in a quotient ring over finite field ? but that is too complex to build. Is there an easy method?

edit retag close merge delete

Sort by » oldest newest most voted

You can define S directly as a field, by defining its modulus by hand (in case the point is to define it explicitely):

sage: R.<x> = PolynomialRing(GF(2), 'x')
sage: S.<y> = GF(2^8, modulus=x^8+x^4+x^3+x+1)
sage: S
Finite Field in y of size 2^8
sage: (y+1).multiplicative_order()
255

more