dh-limlee: Make code return PGEN_ABORT on error, like the comments say.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 11 Feb 2006 20:00:12 +0000 (20:00 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 11 Feb 2006 20:00:12 +0000 (20:00 +0000)
The documentation says it returns PGEN_ABORT on error, but it doesn't:
it returns PGEN_FAIL instead.  Since PGEN_ABORT is -1, it makes sense to
do what the comments say, so make it do that.

dh-limlee.c

index dd11d26..3787305 100644 (file)
@@ -81,7 +81,7 @@ int dh_limlee(dh_param *dp, unsigned ql, unsigned pl,
 
   if ((dp->p = limlee("p", MP_NEW, MP_NEW, ql, pl,
                      r, steps, oev, oec, iev, iec, &nff, &ff)) == 0)
-    return (PGEN_FAIL);
+    return (PGEN_ABORT);
 
   /* --- Now find a primitive element --- */
 
@@ -132,7 +132,7 @@ int dh_limlee(dh_param *dp, unsigned ql, unsigned pl,
   if (!dp->g) {
     mp_drop(dp->p);
     mp_drop(dp->q);
-    return (PGEN_FAIL);
+    return (PGEN_ABORT);
   }
   return (PGEN_DONE);
 }