Processing math: 100%
Ask Your Question
1

irreducible polynomial defining the finite field

asked 7 years ago

omgggggg gravatar image

updated 7 years ago

X = GF(2).polynomial_ring().gen()

F = GF(2^8, name="a", modulus=X^8 + X^6 + X^5 + X + 1)

As example above, the polynomial X^8 + X^6 + X^5 + X + 1 is one of irreducible polynomial defining the finite field GF(2^8).

How can I get all the irreducible polynomial which can define the finite field GF(2^8)?

Preview: (hide)

3 Answers

Sort by » oldest newest most voted
1

answered 7 years ago

B r u n o gravatar image

What you are looking for is the list of all degree-8 irreducible polynomials over F2. There is no built-in function for this, but they can be found very easily if you combine polynomials which iterates over all polynomials of a given degree and is_irreducible that tests irreducibilty.

For instance:

sage: R = GF(2)['x']
sage: for p in R.polynomials(8):
....:     if p.is_irreducible():
....:         print(p)
....:         
x^8 + x^4 + x^3 + x + 1
x^8 + x^4 + x^3 + x^2 + 1
x^8 + x^5 + x^3 + x + 1
[...]
x^8 + x^7 + x^6 + x^5 + x^4 + x^2 + 1
x^8 + x^7 + x^6 + x^5 + x^4 + x^3 + 1

You can also built the list of all of them:

sage: Irr = [p for p in R.polynomials(8) if p is_irreducible()]
sage: len(Irr)
30

Finally, you can have access to some specific irreducible polynomials using R.irreducible_element(algorithm='...'). Have a look at the documentation of irreducible_element for details here.

Preview: (hide)
link
0

answered 7 years ago

dan_fulea gravatar image

This is a good party, so let me join it!

R.<x> = GF(2)[]
[ p for p, mul in factor( x^(2^8)-x ) if p.degree() == 8 ]

This works since any element in F28 is fixed by the Frobenius morphism xx28. The field generators are among these elements, we insist that they have the maximal degree eight (of the minimal polynomial over F2) to pick the generators among all elements. (All ignored multiplicities mul are equal to one.)

This and the other answers show how versatile is sage, and how it supports thinking and experimenting.

Preview: (hide)
link

Comments

Minor correction needed in code above, change "if p is_irreducible()]" to if p.is_irreducible()]

RWBUMP gravatar imageRWBUMP ( 2 years ago )
0

answered 7 years ago

vdelecroix gravatar image

updated 7 years ago

Do you mean

sage: for coeffs in product(GF(2), repeat=8):
....:     p = GF2x(coeffs + (1,))
....:     if p.is_irreducible():
....:         print(p)
....:         
x^8 + x^7 + x^5 + x^4 + 1
x^8 + x^6 + x^5 + x^4 + 1
x^8 + x^7 + x^5 + x^3 + 1
x^8 + x^6 + x^5 + x^3 + 1
x^8 + x^5 + x^4 + x^3 + 1
x^8 + x^7 + x^6 + x^5 + x^4 + x^3 + 1
x^8 + x^6 + x^5 + x^2 + 1
x^8 + x^7 + x^6 + x^5 + x^4 + x^2 + 1
x^8 + x^7 + x^3 + x^2 + 1
x^8 + x^6 + x^3 + x^2 + 1
x^8 + x^5 + x^3 + x^2 + 1
x^8 + x^4 + x^3 + x^2 + 1
x^8 + x^7 + x^6 + x^4 + x^3 + x^2 + 1
x^8 + x^7 + x^5 + x^4 + x^3 + x^2 + 1
x^8 + x^7 + x^6 + x + 1
x^8 + x^7 + x^5 + x + 1
x^8 + x^6 + x^5 + x + 1
x^8 + x^7 + x^6 + x^5 + x^4 + x + 1
x^8 + x^7 + x^3 + x + 1
x^8 + x^5 + x^3 + x + 1
x^8 + x^4 + x^3 + x + 1
x^8 + x^6 + x^5 + x^4 + x^3 + x + 1
x^8 + x^7 + x^2 + x + 1
x^8 + x^7 + x^6 + x^5 + x^2 + x + 1
x^8 + x^7 + x^6 + x^4 + x^2 + x + 1
x^8 + x^6 + x^5 + x^4 + x^2 + x + 1
x^8 + x^7 + x^6 + x^3 + x^2 + x + 1
x^8 + x^7 + x^4 + x^3 + x^2 + x + 1
x^8 + x^6 + x^4 + x^3 + x^2 + x + 1
x^8 + x^5 + x^4 + x^3 + x^2 + x + 1

Some explanations:

  • A polynomial defines GF(2^8) if and only if it has degree 8 and is irreducible
  • the product from itertools allow you to run all through all elements of the Cartesian product GF(2)^8
Preview: (hide)
link

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

Stats

Asked: 7 years ago

Seen: 4,607 times

Last updated: Mar 11 '18