Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
| Download
Lecture 10 Index calculus demonstration
Project: 18.783 Fall 2023
Views: 103License: AGPL3
Image: ubuntu2204
Kernel: SageMath 9.8
In [18]:
In [21]:
172759999368362484802218381207796730807
116233661172610162101636184308802546690=145832000726175811630521625627381669477^110275608763090339577975157297163412476
smoothness bound is 40992
factor base has 4290 elements, searching for 4292 relations...
---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
File <timed exec>:1
Cell In [18], line 45, in dlog(a, b, p)
43 while i < M.nrows():
44 e = randint(Integer(1),p-Integer(1))
---> 45 f=trial_factor(ZZ(a**e*bi),B)
46 if f and f[-Integer(1)][Integer(0)] < B:
47 for q in f:
Cell In [18], line 19, in trial_factor(x, B)
17 lastp=Integer(0)
18 while x > Integer(1):
---> 19 p=x.trial_division(B)
20 if p > B: return []
21 if p == lastp: f[-Integer(1)][Integer(1)] += Integer(1)
File /ext/sage/9.8/src/sage/rings/integer.pyx:3784
, in sage.rings.integer.Integer.trial_division()
3782
3783 # x.value = floor(sqrt(self.value))
-> 3784 sig_on()
3785 mpz_abs(x.value, self.value)
3786 mpz_sqrt(x.value, x.value)
KeyboardInterrupt:
log_145832000726175811630521625627381669477(116233661172610162101636184308802546690) = 107112176129950562
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
Cell In [21], line 11
9 get_ipython().run_line_magic('time', 'y=dlog(a,b,p)')
10 print("log_%d(%d) = %d"%(a,b,y))
---> 11 assert x==y
AssertionError:
In [0]: