Ask Your Question

jbaczuk's profile - activity

2020-05-28 18:26:45 +0200 received badge  Famous Question (source)
2020-02-07 09:15:55 +0200 received badge  Notable Question (source)
2020-02-07 09:15:55 +0200 received badge  Popular Question (source)
2018-10-24 17:46:51 +0200 received badge  Nice Question (source)
2018-10-24 17:36:57 +0200 received badge  Student (source)
2018-10-24 17:02:18 +0200 asked a question Elliptic Curve: Python int too large to convert to C long

I'd like to plot the secp256k1 curve, but I get "Python int too large to convert to C long". Does sage have a built-in type to handle large numbers, or is there a recommended way to do this?

p=2^256 - 2^32 - 2^9 - 2^8 - 2^7 - 2^6 - 2^4 - 1
A=0
B=7
F=GF(p)

F=GF(p)
E = EllipticCurve( [A,B] )
show(graphics_array([plot(E,thickness=3), plot(E.change_ring(GF(p)))]), frame=True)

Traceback:

Traceback (most recent call last):    A=0
  File "", line 1, in <module>

  File "/private/var/folders/k6/lrb1z5jd7vx95c7lh05kq6v00000gn/T/tmpmwcLjo/___code___.py", line 14, in <module>
    exec compile(u'show(graphics_array([plot(E,thickness=_sage_const_3 ), plot(E.change_ring(GF(p)))]), frame=True)
  File "", line 1, in <module>

  File "/Users/Jbaczuk/Documents/Personal/SageMath/local/lib/python2.7/site-packages/sage/misc/decorators.py", line 567, in wrapper
    return func(*args, **options)
  File "/Users/Jbaczuk/Documents/Personal/SageMath/local/lib/python2.7/site-packages/sage/plot/plot.py", line 1941, in plot
    G = funcs.plot(*args, **original_opts)
  File "/Users/Jbaczuk/Documents/Personal/SageMath/local/lib/python2.7/site-packages/sage/schemes/elliptic_curves/ell_finite_field.py", line 107, in plot
    G += plot.points([P[0:2] for P in self.points() if not P.is_zero()], *args, **kwds)
  File "/Users/Jbaczuk/Documents/Personal/SageMath/local/lib/python2.7/site-packages/sage/schemes/elliptic_curves/ell_finite_field.py", line 208, in points
    v = self._points_via_group_structure()
  File "/Users/Jbaczuk/Documents/Personal/SageMath/local/lib/python2.7/site-packages/sage/schemes/elliptic_curves/ell_finite_field.py", line 150, in _points_via_group_structure
    for m in range(1,ni[0]):
OverflowError: Python int too large to convert to C long
2018-10-24 17:02:18 +0200 asked a question secp256k1: Python int too large to convert to C long

I'd like to plot the secp2561 elliptic curve, but I get "Python int too large to convert to C long". Does sage have a built-in type that will allow p to be very large?

p=2^256 - 2^32 - 2^9 - 2^8 - 2^7 - 2^6 - 2^4 - 1
A=0
B=7
F=GF(p)

F=GF(p)
E = EllipticCurve( [A,B] )
show(graphics_array([plot(E,thickness=3), plot(E.change_ring(GF(p)))]), frame=True)