Ask Your Question
1

Modular reduction in Galois fields

asked 2013-04-28 07:04:04 +0100

Christian_Kossmann gravatar image

I want to compute x^6 mod x^5+x^2+1 in the Galois Field GF(2^5). Does anyone know how to do this in SAGE?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2013-04-28 08:18:18 +0100

tmonteil gravatar image

updated 2013-04-28 08:43:24 +0100

First, define k to be the field GF(2^5), whose generator is named a:

sage: k.<a> = FiniteField(2^5); k
Finite Field in a of size 2^5

Alternatively :

sage: k = GF(2^5, 'a'); k
Finite Field in a of size 2^5

Then, define the polynomial ring k[x]:

sage: R.<x> = PolynomialRing(k); R
Univariate Polynomial Ring in x over Finite Field in a of size 2^5

Alternatively:

sage: R = k['x']; R
Univariate Polynomial Ring in x over Finite Field in a of size 2^5

Then, do your computation in R:

sage: P = R(x^6)
sage: P.mod(x^5+x^2+1)
x^3 + x
edit flag offensive delete link more

Comments

Thank you very much - helped me a lot!

Christian_Kossmann gravatar imageChristian_Kossmann ( 2013-04-28 08:58:42 +0100 )edit

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2013-04-28 07:04:04 +0100

Seen: 1,121 times

Last updated: Apr 28 '13