rhodes: Don't try to CRT-recombine a single log.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 28 May 2017 18:03:08 +0000 (19:03 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 19 Jun 2017 09:28:47 +0000 (10:28 +0100)
This is, properly speaking, a catacomb-python bug, I think.

rhodes

diff --git a/rhodes b/rhodes
index 092e97a..8152999 100755 (executable)
--- a/rhodes
+++ b/rhodes
@@ -490,7 +490,8 @@ def step(dir, cmd, *args):
           p, n = C.MP(pstr), C.MP(nstr)
           qq.append(p**e)
           nn.append(n)
-        n = C.MPCRT(qq).solve(nn)
+        if len(qq) == 1: n = nn[0]
+        else: n = C.MPCRT(qq).solve(nn)
 
         ## One last check that this is the right answer.
         xx = G.pow(g, n)