First time here? Check out the FAQ!

Ask Your Question
1

Modular reduction in Galois fields

asked 11 years ago

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
3

answered 11 years ago

tmonteil gravatar image

updated 11 years ago

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
Preview: (hide)
link

Comments

Thank you very much - helped me a lot!

Christian_Kossmann gravatar imageChristian_Kossmann ( 11 years ago )

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: 11 years ago

Seen: 1,156 times

Last updated: Apr 28 '13