From f39a39c92bc544254baf4d158e8e41755369c557 Mon Sep 17 00:00:00 2001 From: mdw Date: Sat, 17 Jun 2000 11:52:12 +0000 Subject: [PATCH] Add the GCD filter. --- pgen.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/pgen.h b/pgen.h index 05d0a2c..1277b3d 100644 --- 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@ --- * -- 2.11.0