Add the GCD filter.
authormdw <mdw>
Sat, 17 Jun 2000 11:52:12 +0000 (11:52 +0000)
committermdw <mdw>
Sat, 17 Jun 2000 11:52:12 +0000 (11:52 +0000)
pgen.h

diff --git a/pgen.h b/pgen.h
index 05d0a2c..1277b3d 100644 (file)
--- a/pgen.h
+++ b/pgen.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: pgen.h,v 1.5 2000/02/12 18:21:03 mdw Exp $
+ * $Id: pgen.h,v 1.6 2000/06/17 11:52:12 mdw Exp $
  *
  * Prime generation glue
  *
@@ -30,6 +30,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: pgen.h,v $
+ * Revision 1.6  2000/06/17 11:52:12  mdw
+ * Add the GCD filter.
+ *
  * Revision 1.5  2000/02/12 18:21:03  mdw
  * Overhaul of key management (again).
  *
@@ -219,6 +222,24 @@ typedef struct pgen_safetestctx {
 
 extern int pgen_safetest(int /*rq*/, pgen_event */*ev*/, void */*p*/);
 
+/*----- Miscellaneous steppers and testers --------------------------------*/
+
+typedef struct pgen_gcdstepctx {
+  pfilt p, jp;                         /* Prime filter and step filter */
+  mp *q, *jq;                          /* %$p - 1$%, and a step value*/
+  mp *r;                               /* Other argument for GCD */
+  mp *g;                               /* GCD output (must be inited) */
+  mp *max;                             /* Maximum permissible GCD */
+} pgen_gcdstepctx;
+
+/* --- @pgen_gcdstep@ --- *
+ *
+ * Steps @p@ and @q@, until @p@ has no small factors, and
+ * %$\gcd(p, r) \le max$%.
+ */
+
+extern int pgen_gcdstep(int /*rq*/, pgen_event */*ev*/, void */*p*/);
+
 /*----- Standard event handlers -------------------------------------------*/
 
 /* --- @pgen_evspin@ --- *