bbs-gen: Don't use the safe stepper.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 11 Feb 2006 15:34:37 +0000 (15:34 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 11 Feb 2006 15:34:37 +0000 (15:34 +0000)
This didn't use the safe-tester anyway.  I no longer understand why this
code was ever written this way, and since I want to eradicate the safe
stepper, this seems a good change now.

bbs-gen.c

index 9afa245..3b419af 100644 (file)
--- a/bbs-gen.c
+++ b/bbs-gen.c
@@ -63,7 +63,8 @@ int bbs_gen(bbs_priv *bp, unsigned nbits, grand *r, unsigned n,
            pgen_proc *event, void *ectx)
 {
   rabin rb;
-  pgen_safejumpctx j;
+  pfilt jp;
+  pgen_jumpctx j;
   pgen_gcdstepctx g;
   unsigned nb = nbits/2;
   mp *x = MP_NEW;
@@ -71,11 +72,12 @@ int bbs_gen(bbs_priv *bp, unsigned nbits, grand *r, unsigned n,
   /* --- Generate @p@ --- */
 
 again:
-  if ((x = strongprime_setup("p", x, &j.jq, nb, r, n, event, ectx)) == 0)
+  if ((x = strongprime_setup("p", x, &jp, nb, r, n, event, ectx)) == 0)
     goto fail_x;
-  bp->p = pgen("p", MP_NEW, x, event, ectx, n, pgen_safejump, &j,
+  j.j = &jp;
+  bp->p = pgen("p", MP_NEW, x, event, ectx, n, pgen_jump, &j,
               rabin_iters(nb), pgen_test, &rb);
-  pfilt_destroy(&j.jq);
+  pfilt_destroy(&jp);
   if (!bp->p) {
     if (n)
       goto fail_p;