... thanks, by your attention, I am reading a documentation to Implement
Galois Field in other place, ...

and declare in C this

static unsigned prim_poly[MAX_EXT_DEG + 1] = {◦1 , ◦3 ,
/∗ not used ∗/
◦7 , ◦13 , ◦23 , ◦45 , ◦103 , ◦203 , ◦435 , ◦1041 , ◦2011 , ◦4005 , ◦10123
, ◦20033 , ◦42103 , ◦100003 , ◦210013 }

and use for example 435 in representative poynomial is x^8+x^7+x^4+x^3+x+1
to build GF(2^8), and say "α is chosen as root of a primitive polynomial f
. As outlined above, α does have the explicit form X + I(f ).
Multiplying by α means therefore multiplying by X modulo I(f ), which in
turn in binary means a right
shift by one bit position. By successively multiplying the previous field
element in the exponential table by
α, we generate the whole field: gf_exp[i − 1]·α = α^i.",

gf_exp = malloc((1 ≪ gf_extd) ∗ sizeof (∗gf_exp));
/∗ fetch some memory ∗/
gf_exp[0] = 1;
for (i = 1; i < gf_ord; ++ i) {
gf_exp[i] = gf_exp[i − 1] ≪ 1;
/∗ multiply by α ∗/
if (gf_exp[i − 1] & (1 ≪ (gf_extd − 1)))
/∗ modulo I(f ),i.e. ∗/
gf_exp[i] ⊕= prim_poly[gf_extd];
/∗ substract f for powers too high ∗/
}
gf_exp[gf_ord] = 1;
/∗ should be 0: hack for the multiplication ∗/

My question is, SAGE implement GF in same form?


;



2011/12/11 achrzesz <achrz...@wp.pl>

>
>
> On Dec 12, 12:31 am, achrzesz <achrz...@wp.pl> wrote:
> > On Dec 12, 12:10 am, juaninf <juan...@gmail.com> wrote:
> >
> >
> >
> > > Hi everybody
> >
> > > I want choose different minimal polynomial to build a Galois Field
> > > 2^m, how?
> >
> > > For example: m = 8
> >
> > > sageF.<a>=GF(2^8)
> > > sage:print a.minpoly()
> > > I get ...
> > > x^8 + x^4 + x^3 + x^2 + 1
> > > but I want now other polynomial for example
> > > x^8+x^7+x^4+x^3+x+1
> > > How?
> >
> > > thanks
> >
> > sage: K.<z>=GF(2)[]
> > sage: F.<x>=GF(2^8,name='x',modulus=z^8+z^4+z^3+z+1)
> > sage: F
> > Finite Field in x of size 2^8
> > sage: F.polynomial()
> > x^8 + x^4 + x^3 + x + 1
> >
> > Andrzej Chrzeszczyk
>
> sage: z=K.gen()
> sage: f=z^8+z^7+z^4+z^3+z+1
> sage: f.is_irreducible()
> False
>
> Andrzej Chrzeszczyk
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>



-- 
---------------------------------------------------------------------
Juan del Carmen Grados Vásquez
Laboratório Nacional de Computação Científica
Tel: +55 24 2233-6260
(http://www.lncc.br/)
http://juaninf.blogspot.com
---------------------------------------------------------------------

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to