Keep numbers positive.
authormdw <mdw>
Thu, 1 Apr 2004 13:37:07 +0000 (13:37 +0000)
committermdw <mdw>
Thu, 1 Apr 2004 13:37:07 +0000 (13:37 +0000)
calc/ecp.cal

index 3834359..10ed9e4 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-apcalc-*-
  *
- * $Id: ecp.cal,v 1.3 2004/03/23 15:19:32 mdw Exp $
+ * $Id: ecp.cal,v 1.4 2004/04/01 13:37:07 mdw Exp $
  *
  * Testbed for elliptic curve arithmetic over prime fields
  *
@@ -30,6 +30,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: ecp.cal,v $
+ * Revision 1.4  2004/04/01 13:37:07  mdw
+ * Keep numbers positive.
+ *
  * Revision 1.3  2004/03/23 15:19:32  mdw
  * Test elliptic curves more thoroughly.
  *
@@ -126,7 +129,7 @@ define ecp_pt_neg(a)
 {
   local obj ecp_pt d;
   d.x = a.x;
-  d.y = -a.y;
+  d.y = a.e.p - a.y;
   d.e = a.e;
   return (d);
 }