I am working in version 4.1.1. It says that log only works when the base is
a generator of the multiplicative group of the finite field.

 For example if you work in GF(11), 5 is not a generator of the
multiplicative group, although it is clear that 5^2 = 3 mod 11, but when
using sage:

sage: p = GF(11)(5)
sage: p.multiplicative_order()
5
sage: b=GF(11)(3)
sage: b.log(p)
Traceback (most recent call last):
...
ValueError: base (=5) for discrete log must generate multiplicative group



On 6 March 2010 12:40, Alasdair <amc...@gmail.com> wrote:

> What version of Sage are you using? - log works fine for me (version
> 4.2.1):
>
> sage: F.<x>=GF(2^8,"x")
> sage: (x+1).multiplicative_order()
>  51
> sage: (x+1)^30
>  x^5 + x^3 + x^2
> sage: (x^5+x^3+x^2).log(x+1)
>  30
>
> cheers,
> Alasdair
>
> On Mar 5, 11:03 pm, yujia chiu <woodc...@gmail.com> wrote:
> > Dear all,
> >
> > I tried to compute the logarithm of b based a in a finite field. But it
> > seemed that the b.log(a) command in sage only works when a generates the
> > multiplicative group of the finite field. Unfortunately, my a doesn't,
> > although I already showed that b is indeed a power of a.
> > Could you please tell me how to solve this problem? Thanks in advance.
> >
> > --
> > Kind Regards,
> > Yujia Qiu
>
> --
> 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<sage-support%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>



-- 
Kind Regards,
Yujia Qiu

-- 
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