Re: [sage-devel] Bug in `discrete_log(...,bounds=(1,p.isqrt()))`

2024-06-30 Thread Georgi Guninski
> Instead, the algorithm should error out, since number theory shows there's no > non-zero (mod 2^61 - 2) solution to 3^a = 1 mod (2^61 - 1) Why do you reduce (mod p-1)? (p-1) is valid integer solution by Euler's theorem. -- You received this message because you are subscribed to the Google Grou

Re: [sage-devel] Bug in `discrete_log(...,bounds=(1,p.isqrt()))`

2024-06-30 Thread Gareth Ma
I think so too. Here's a more minimal version (note a == 1 in your example): p = 31 g = GF(31)(3) discrete_log(1, g, bounds=(1, 6), algorithm="lambda", operation="*") # 6 g^6 # 16 It seems there's some serious bugs going on, as the return value isn't in the bounds: K = GF(2^61 - 1) d = discrete_

[sage-devel] Bug in `discrete_log(...,bounds=(1,p.isqrt()))`

2024-06-30 Thread Georgi Guninski
I think this is bug: p=2**61-1;Kp=GF(p);g=Kp(3);X=p//3;a=g**X dl=discrete_log(a,g,bounds=(1,p.isqrt()),algorithm="lambda",operation="*") dl2=discrete_log(a,g,bounds=(1,p),algorithm="lambda",operation="*") (g**dl==a,g**dl2==a) #(False, True) -- You received this message because you are subscribe