Opened 16 years ago

Last modified 16 years ago

#305 enhancement closed fixed (fixed)

use tgmp to accelerate conch

Reported by: z3p Owned by:
Priority: normal Milestone:
Component: Keywords:
Cc: z3p Branch:
Author:

Description


Change History (6)

comment:1 Changed 16 years ago by Moshe Zadka

I propose, in that case, stopping to use tgmp until it is fixed, rename
this bug to "use tgmp to accelerate conch" and mark it feature.

Here is a patch:
Index: twisted/conch/ssh/common.py
===================================================================
RCS file: /cvs/Twisted/twisted/conch/ssh/common.py,v
retrieving revision 1.7
diff -u -r1.7 common.py
--- twisted/conch/ssh/common.py 3 Dec 2002 21:33:17 -0000       1.7
+++ twisted/conch/ssh/common.py 21 Oct 2003 15:43:02 -0000
@@ -79,16 +79,16 @@
 MP_py = MP
 _MPpow_py = _MPpow

-try:
-    import tgmp
-    getMP = tgmp.getMP
-    MP = tgmp.MP
-    _MPpow = tgmp._MPpow
-    pyPow = pow
-    def tgmpPow(x, y, z = None):
-        if not z:
-            return pyPow(x, y) # tgmp.pow only does 3 args
-        return apply(tgmp.pow, map(long, (x,y,z)))
-    __builtins__['pow'] = tgmpPow # this is probably evil
-except ImportError:
-    pass
+#try:
+#    import tgmp
+#    getMP = tgmp.getMP
+#    MP = tgmp.MP
+#    _MPpow = tgmp._MPpow
+#    pyPow = pow
+#    def tgmpPow(x, y, z = None):
+#        if not z:
+#            return pyPow(x, y) # tgmp.pow only does 3 args
+#        return apply(tgmp.pow, map(long, (x,y,z)))
+#    __builtins__['pow'] = tgmpPow # this is probably evil
+#except ImportError:
+#    pass

comment:2 Changed 16 years ago by z3p

Patch commited, name changed, priority decreased.

comment:3 Changed 16 years ago by itamarst

Any reason you didn't use mpz, btw? It's semi-standard in Python (dunno if it's
included in windows).

comment:4 Changed 16 years ago by Moshe Zadka

mpz doesn't have the needed functionality

comment:5 Changed 16 years ago by z3p

Conch will now use GMPy if it's available.  It has the required functionality,
works with an appropriate version of GMP, and works on Windows.

comment:6 Changed 9 years ago by <automation>

Owner: z3p deleted
Note: See TracTickets for help on using tickets.