Just use
Sage Cell Server, and pick "Python" instead of "Sage", then it will point you directly to all errors:
(0 : 1 : 0)
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
Cell In [1], line 1
----> 1 exec("""p = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f
2 n = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141
3
4 E = EllipticCurve(GF(p), [0, 7])
5
6 G = E.point( (0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798,0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8)) # Base point
7
8 def egcd(a, b):
9
10 if a == 0:
11
12 return (b, 0, 1)
13
14 else:
15
16 g, y, x = egcd(b % a, a)
17
18 return (g, x - (b // a) * y, y)
19 def modinv(a, m):
20
21 g, x, y = egcd(a, m)
22
23 if g != 1:
24
25 raise Exception('modular inverse does not exist')
26
27 else:
28
29 return x % m
30
31 def verify(r, s,z,public_key):
32 w = int(modinv(s, n))
33 u1 = int((z * w) % n)
34 u2 = int((r * w) % n)
35 D=u1*G + u2*public_key
36 print(D)
37 x,y=D.xy()
38 x=int(x)
39
40 if (r % n) == (x % n):
41 print( \"signature matches\")
42 return 1
43 else:
44 print(\"invalid signature\",r,x%n,hex(int(x%n)))
45 return -1
46
47
48 r= 62954891018019954459416693598720448029687590245972400008829669497225918091177
49 s= 93805659226466445992581382639747054957343960360429636701520966540504046012794
50 z= 42110502646696890819993970892170079655178794598857292674837771894242690992680
51 priv= 60730954188027216046258787068258904013610447813898304297373912116496774227312
52
53 pub=priv*G
54 print(verify(r,s,z,pub))
55 """)
File :54
File :37, in verify(r, s, z, public_key)
File /home/sc_serv/sage/src/sage/schemes/elliptic_curves/ell_point.py:776, in EllipticCurvePoint_field.xy(self)
774 return self[0], self[1]
775 else:
--> 776 return self[0]/self[2], self[1]/self[2]
File /home/sc_serv/sage/src/sage/structure/element.pyx:1730, in sage.structure.element.Element.__truediv__()
1728 cdef int cl = classify_elements(left, right)
1729 if HAVE_SAME_PARENT(cl):
-> 1730 return (left)._div_(right)
1731 if BOTH_ARE_ELEMENT(cl):
1732 return coercion_model.bin_op(left, right, truediv)
File /home/sc_serv/sage/src/sage/rings/finite_rings/integer_mod.pyx:2248, in sage.rings.finite_rings.integer_mod.IntegerMod_gmp._div_()
2246 71428571429
2247 """
-> 2248 return self._mul_(~right)
2249
2250 def __int__(self):
File /home/sc_serv/sage/src/sage/rings/finite_rings/integer_mod.pyx:2334, in sage.rings.finite_rings.integer_mod.IntegerMod_gmp.__invert__()
2332 """
2333 if self.is_zero():
-> 2334 raise ZeroDivisionError(f"inverse of Mod(0, {self.__modulus.sageInteger}) does not exist")
2335
2336 cdef IntegerMod_gmp x
ZeroDivisionError: inverse of Mod(0, 115792089237316195423570985008687907853269984665640564039457584007908834671663) does not exist