I have used log_repr() and expect that it return y of equation x^y = z. I also believed hat k.gen() return generator of the field.
Now I must use following construction for solving my problem sage: R.<x>=ZZ[] sage: k=GF(2^8,name='a',modulus=x^8+x^4+x^3+x+1) sage: a = k.multiplicative_generator() sage: a^ZZ(k(ZZ(3).digits(2)).log(a)) == k(ZZ(3).digits(2)) By the way, any of next functions don't return the value y of equation x^y=z sage: b=K(ZZ(3).digits(2)) sage: b a + 1 sage: b.log_repr() '1' sage: b.log_to_int() 3 I think that log_repr() should has the same logic as int_repr() or integer_representation(), i.e. sage: a=K.multiplicative_generator() sage: ZZ(K(ZZ(3).digits(2)).log(a)) 164 What do you think? Kind regards, Oleksandr On Tuesday, May 29, 2012 12:52:16 PM UTC+3, AlexGhitza wrote: > > Hi, > > On Mon, May 21, 2012 at 9:29 AM, Oleksandr Kazymyrov > <vrona.aka.ham...@gmail.com> wrote: > > I have encountered the following problem In Sage 5.0: > > sage: R.<x>=ZZ[] > > sage: k=GF(2^8,name='a',modulus=x^8+x^4+x^3+x+1) > > sage: k(ZZ(3).digits(2)) > > a + 1 > > sage: k.gen()^ZZ(k(ZZ(3).digits(2)).log_repr()) > > a > > sage: k.gen()^ZZ(k(ZZ(3).digits(2)).log_repr()) == k(ZZ(3).digits(2)) > > False > > sage: k("a+1")^ZZ(k(ZZ(3).digits(2)).log_repr()) == k(ZZ(3).digits(2)) > > True > > > > It easy see that k.gen() or k.multiplicative_generator() is not a > generator > > of the finite field: > > sage: k.multiplicative_generator() > > a^4 + a + 1 > > Why is it clear that a^4+a+1 is not a multiplicative generator? I think > it is: > > sage: k.<a> = GF(2^8, names='a', name='a', modulus=x^8+x^4+x^3+x+1) > sage: (a^4+a+1).multiplicative_order() > 255 > > Indeed, so is a+1: > sage: (a+1).multiplicative_order() > 255 > > The docs for multiplicative_generator() say: "return a generator of > the multiplicative group", then add "Warning: This generator might > change from one version of Sage to another." > > > -- > Best, > Alex > > -- > Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne > http://aghitza.org > -- 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