Breaks ABI! Add identification slots to abstract groups and elliptic
[u/mdw/catacomb] / ec-info.c
index 4f852c2..6b5e08e 100644 (file)
--- a/ec-info.c
+++ b/ec-info.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: ec-info.c,v 1.7 2004/04/17 09:58:37 mdw Exp $
+ * $Id$
  *
  * Elliptic curve information management
  *
@@ -325,7 +325,7 @@ void ec_freeinfo(ec_info *ei)
 
 static int primeeltp(mp *x, field *f)
 {
-  return (!MP_ISNEG(x) && MP_CMP(x, <, f->m));
+  return (!MP_NEGP(x) && MP_CMP(x, <, f->m));
 }
 
 static const char *primecheck(const ec_info *ei, grand *gr)
@@ -551,20 +551,23 @@ int main(int argc, char *argv[])
       }
     }
   } else {
-    fputs("checking standard curves", stdout);
+    fputs("checking standard curves...\n", stdout);
     for (ee = ectab; ee->name; ee++) {
       ec_info ei;
+      printf("  %s: ", ee->name);
+      fflush(stdout);
       getinfo(&ei, ee->data);
       e = ec_checkinfo(&ei, gr);
       ec_freeinfo(&ei);
       if (e) {
-       fprintf(stderr, "\n*** curve %s fails: %s\n", ee->name, e);
+       printf("fails: %s\n", e);
        ok = 0;
-      }
-      putchar('.');
+      } else
+       fputs("ok\n", stdout);
       fflush(stdout);
     }
-    fputs(ok ? " ok\n" : " failed\n", stdout);
+    if (ok)
+      fputs("all ok\n", stdout);
   }
   gr->ops->destroy(gr);
   return (!ok);