+/* --- @strongprime@ --- *
+ *
+ * Arguments: @const char *name@ = pointer to name root
+ * @mp *d@ = destination integer
+ * @unsigned nbits@ = number of bits wanted
+ * @grand *r@ = random number source
+ * @unsigned n@ = number of attempts to make
+ * @pgen_proc *event@ = event handler function
+ * @void *ectx@ = argument for the event handler
+ *
+ * Returns: A `strong' prime, or zero.
+ *
+ * Use: Finds `strong' primes. A strong prime %$p$% is such that
+ *
+ * * %$p - 1$% has a large prime factor %$r$%,
+ * * %$p + 1$% has a large prime factor %$s$%, and
+ * * %$r - 1$% has a large prime factor %$t$%.
+ *
+ * The numbers produced may be slightly larger than requested,
+ * by a few bits.
+ */
+
+mp *strongprime(const char *name, mp *d, unsigned nbits, grand *r,
+ unsigned n, pgen_proc *event, void *ectx)
+{
+ pfilt f;
+ pgen_jumpctx j;
+ rabin rb;
+
+ d = strongprime_setup(name, d, &f, nbits, r, n, event, ectx);
+ j.j = &f;
+ d = pgen(name, d, d, event, ectx, n, pgen_jump, &j,
+ rabin_iters(nbits), pgen_test, &rb);
+ pfilt_destroy(&f);
+ return (d);
+}
+