3 * $Id: strongprime.h,v 1.1 1999/12/22 15:51:22 mdw Exp $
5 * Generate `strong' prime numbers
7 * (c) 1999 Straylight/Edgeware
10 /*----- Licensing notice --------------------------------------------------*
12 * This file is part of Catacomb.
14 * Catacomb is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU Library General Public License as
16 * published by the Free Software Foundation; either version 2 of the
17 * License, or (at your option) any later version.
19 * Catacomb is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with Catacomb; if not, write to the Free
26 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
30 /*----- Revision history --------------------------------------------------*
32 * $Log: strongprime.h,v $
33 * Revision 1.1 1999/12/22 15:51:22 mdw
34 * Find `strong' RSA primes using Gordon's algorithm.
38 #ifndef CATACOMB_STRONGPRIME_H
39 #define CATACOMB_STRONGPRIME_H
45 /*----- Header files ------------------------------------------------------*/
47 #ifndef CATACOMB_GRAND_H
51 #ifndef CATACOMB_PGEN_H
55 /*----- Functions provided ------------------------------------------------*/
57 /* --- @strongprime@ --- *
59 * Arguments: @const char *name@ = pointer to name root
60 * @mp *d@ = destination integer
61 * @unsigned nbits@ = number of bits wanted
62 * @grand *r@ = random number source
63 * @unsigned n@ = number of attempts to make
64 * @pgen_proc *event@ = event handler function
65 * @void *ectx@ = argument for the event handler
67 * Returns: A `strong' prime, or zero.
69 * Use: Finds `strong' primes. A strong prime %$p$% is such that
71 * * %$p - 1$% has a large prime factor %$r$%,
72 * * %$p + 1$% has a large prime factor %$s$%, and
73 * * %$r - 1$% has a large prime factor %$t$%.
75 * The numbers produced may be slightly larger than requested,
79 extern mp
*strongprime(const char */
*name*/
, mp */
*d*/
, unsigned /*nbits*/,
80 grand */
*r*/
, unsigned /*n*/,
81 pgen_proc */
*event*/
, void */
*ectx*/
);
83 /*----- That's all, folks -------------------------------------------------*/