[Ecm-commits] r2386 - trunk

cvs commits ecm-commits at lists.gforge.inria.fr
Sun Feb 10 18:30:00 CET 2013


Author: morain
Date: 2013-02-10 18:29:59 +0100 (Sun, 10 Feb 2013)
New Revision: 2386

Log:
Bug fix.


Modified:
   trunk/cmecm.c
   trunk/stage2.c
Modified: trunk/cmecm.c
===================================================================
--- trunk/cmecm.c	2013-02-10 16:45:51 UTC (rev 2385)
+++ trunk/cmecm.c	2013-02-10 17:29:59 UTC (rev 2386)
@@ -710,6 +710,11 @@
 	long num[] = {2, -1, 4*12, -18*12*12};
 	long den[] = {1, 2, -8*12};
 
+	mpres_t tmp;
+	mpres_init(tmp, modulus);
+	mpres_mul(tmp, sq[0], sq[0], modulus);
+	mpres_add_ui(tmp, tmp, 2, modulus);
+	printf("sq^2+2="); print_mpz_from_mpres(tmp, modulus); printf(";\n");
 	ret = eval_CM_mult(omegaP, P, num, den, sq, modulus);
     }
     return ret;

Modified: trunk/stage2.c
===================================================================
--- trunk/stage2.c	2013-02-10 16:45:51 UTC (rev 2385)
+++ trunk/stage2.c	2013-02-10 17:29:59 UTC (rev 2386)
@@ -360,6 +360,11 @@
       use_ntt = 0; /* don't use NTT for Fermat numbers */
     }
 
+  if(mpz_cmp_ui(((curve *)X)->sq[0], 1) == 0){
+      disc = 0;
+      ((curve *)X)->disc = 0; /* humf */
+  }
+
   if(disc != 0){
       /* CM case, we override dF and k */
       set_stage2_params_CM(&dF, &k, B2, disc);




More information about the Ecm-commits mailing list