Ask Your Question

construction of extension field over GF(2^3)

asked 2016-08-18 08:36:53 +0200

santoshi gravatar image

updated 2016-08-19 00:43:53 +0200

tmonteil gravatar image

My base field is GF(2^3) and to construct the field i am using irreducible polynomial p(x)=x^3+x+1. the extension field is GF(2^3)^2 and i want to construct this field using irreducible polynomial p(z)= z^2+(a^2+a+1)*z+a^2 where (a^2+a+1 and a^2 are the elements of field GF(2^3)) where a is represent theta that is root of irreducible polynomial over GF(2^3) . i have written the code in sage but it gives me error .

for i in enumerate(K):  print i 
K1.<b> = GF(K,'modulus=x^2+(a^2+a+1)*x+a^2');K1.modulus()
edit retag flag offensive close merge delete


  1. The code you give should be indented since it is completely unreadable, and you should mention the error(s) you get.
  2. Have you read my answer to your previous question?
B r u n o gravatar imageB r u n o ( 2016-08-18 10:01:26 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-03-04 04:37:42 +0200

dan_fulea gravatar image

There are many reasons, why errors occur for the above code, it is hard to guess which is the first one, the one given by the interpreter. First of all, the following works in the sense of the title, and is closest to the posted code:

sage: K.<a> = GF(2^3)
sage: a.minpoly()
x^3 + x + 1
sage: K.modulus()
x^3 + x + 1
sage: R.<x> = PolynomialRing( K )
sage: L.<b> = K.extension( x^2 + (a^2+a+1)*x + a^2 )
sage: L.order()
sage: b.minpoly()
x^2 + (a^2 + a + 1)*x + a^2
sage: L.modulus()
b^2 + (a^2 + a + 1)*b + a^2
sage: L.base()
Univariate Polynomial Ring in b over Finite Field in a of size 2^3

Let us compare with:

GF( K, 'modulus=x^2+(a^2+a+1)*x+a^2' );    # errors

The first argument of GF is... a field, not a prime power.

The second argument is... not optional, but a string, and inside the string there is a substring modulus... No chance.


Now the above sample lines produce a field L where a, b liven in, but it is not simple to work there. For instance, if one calls the multiplicative order on b, there are problems. So it may be better to first construct in a row L as the field with 2^6 elements, then pick inside two elements playing the roles of a and b. (Instead of L, a, b the following code uses the notations M, A, B.)

sage: M = GF( 2^6 )
sage: R.<x> = PolynomialRing( M )
sage: A = ( x^3 + x + 1             ).roots( multiplicities=False )[0]
sage: B = ( x^2 + (A^2+A+1)*x + A^2 ).roots( multiplicities=False )[0]

sage: B.multiplicative_order()
sage: A.multiplicative_order()

sage: A.minpoly()
x^3 + x + 1
sage: B.minpoly()    # over the prime field
x^6 + x^5 + x^2 + x + 1
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-08-18 08:36:53 +0200

Seen: 417 times

Last updated: Mar 04 '17