I was trying to compute Discrete logarithm using sage built in method (Don't worry I am not breaking anyone encryption :))
Firstly I defined:
sage: K = IntegerModRing(1042581697795350988926375176023147567119634654525968384680064458805236495557780186336768321198680378827882923866690089649068437728564380119971343897249733757180088154026480449177119491716013304499492130858244810907376593879710509787)
sage: bet = K(555780511850336599590213333717318815910873825538052251610340319714352106225826998876713496327750311385082389857312090818482139320119124693186033344647111179528404852638310198274804551640237429724147046130759135433389268219707958469)
sage: K(2).multiplicative_order()
1042581697795350988926375176023147567119634654525968384680064458805236495557780186336768321198680378827882923866690089649068437728564380119971343897249733757180088154026480449177119491716013304499492130858244810907376593879710509786
Then tried to compute:
sage: %time discrete_log_rho(bet, K(2), K(2).order())
After that this irritating error appeared:
sage: %time discrete_log_rho(bet, K(2), K(2).order())
---------------------------------------------------------------------------
OverflowError Traceback (most recent call last)
<ipython-input-16-02136e0a9c28> in <module>()
----> 1 get_ipython().magic(u'time discrete_log_rho(bet, K(2), K(2).order())')
/home/PRIVATE/sage-6.9-x86_64-Linux/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)
2334 magic_name, _, magic_arg_s = arg_s.partition(' ')
2335 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2336 return self.run_line_magic(magic_name, magic_arg_s)
2337
2338 #-------------------------------------------------------------------------
/home/PRIVATE/sage-6.9-x86_64-Linux/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)
2255 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2256 with self.builtin_trap:
-> 2257 result = fn(*args,**kwargs)
2258 return result
2259
/home/PRIVATE/sage-6.9-x86_64-Linux/local/lib/python2.7/site-packages/IPython/core/magics/execution.pyc in time(self, line, cell, local_ns)
/home/PRIVATE/sage-6.9-x86_64-Linux/local/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
191 # but it's overkill for just that one bit of state.
192 def magic_deco(arg):
--> 193 call = lambda f, *a, **k: f(*a, **k)
194
195 if callable(arg):
/home/PRIVATE/sage-6.9-x86_64-Linux/local/lib/python2.7/site-packages/IPython/core/magics/execution.pyc in time(self, line, cell, local_ns)
1161 if mode=='eval':
1162 st = clock2()
-> 1163 out = eval(code, glob, local_ns)
1164 end = clock2()
1165 else:
<timed eval> in <module>()
/home/PRIVATE/sage-6.9-x86_64-Linux/local/lib/python2.7/site-packages/sage/groups/generic.pyc in discrete_log_rho(a, base, ord, operation, hash_function)
627 i0=0
628 nextsigma = 0
--> 629 for i in xrange(reset_bound):
630 #random walk, we need an efficient hash
631 s=hash_function(x) % partition_size
OverflowError: Python int too large to convert to C long
I can't get my head around this problem, I've tried to edit groups.py replacing xrange by itertools as suggested in hxxp://stackoverflow.com/questions/22114088/overflowerror-python-int-too-large-to-convert-to-c-long but the same problem still there!
Hints would be appreciated.