Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Binary fields

Hello, I would like to perform the following on a binary field, i.e. GF(2^m).

  1. Define a polynomial and solve the polynomial over a binary field.
  2. Convert an element of the binary field into a bit string.

For the first, I've tried the following:

K = GF(2^7,'a');
PK.<x>=K[]; #I've also tried "x = PolynomialRing(GF(2^7,'a'),'x').gen"
f = (a^6 + a^3 + a)*x^2 + (a^6 + a^4 + a^3)*x + (a^5 + a^4 + a^3 + a^2 + 1);
print f.roots();

But the error is TypeError: unable to coerce from a finite field other than the prime subfield.

I have no clue to the second. I have tried in vain to find some help online but was unable to, so if you have any resources that could point me in the right direction, I'll be very thankful for your help!

Binary fields

Hello, I would like to perform the following on a binary field, i.e. GF(2^m).

  1. Define a polynomial and solve the polynomial over a binary field.
  2. Convert an element of the binary field into a bit string.

For the first, I've tried the following:

K = GF(2^7,'a');
PK.<x>=K[]; #I've also tried "x = PolynomialRing(GF(2^7,'a'),'x').gen"
f = (a^6 + a^3 + a)*x^2 + (a^6 + a^4 + a^3)*x + (a^5 + a^4 + a^3 + a^2 + 1);
print f.roots();

But the error is TypeError: unable to coerce from a finite field other than the prime subfield.

For the second, I have no clue would like to the second. I have tried know how finite field elements are stored in vain to find some help online but was unable to, so if SAGE, are they stored as vectors?

If you have any resources that could point me in the right direction, I'll be very thankful for your help!