3 * $Id: limlee.h,v 1.1 2000/07/09 21:30:58 mdw Exp $
5 * Generate Lim-Lee primes
7 * (c) 2000 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 --------------------------------------------------*
33 * Revision 1.1 2000/07/09 21:30:58 mdw
34 * Lim-Lee prime generation.
38 #ifndef CATACOMB_LIMLEE_H
39 #define CATACOMB_LIMLEE_H
45 /*----- Header files ------------------------------------------------------*/
47 #ifndef CATACOMB_GRAND_H
55 #ifndef CATACOMB_PGEN_H
59 /*----- Functions provided ------------------------------------------------*/
63 * Arguments: @const char *name@ = pointer to name root
64 * @mp *d@ = pointer to destination integer
65 * @mp *newp@ = how to generate factor primes
66 * @unsigned ql@ = size of individual factors
67 * @unsigned pl@ = size of large prime
68 * @grand *r@ = a random number source
69 * @unsigned on@ = number of outer attempts to make
70 * @pgen_proc *oev@ = outer event handler function
71 * @void *oec@ = argument for the outer event handler
72 * @pgen_proc *iev@ = inner event handler function
73 * @void *iec@ = argument for the inner event handler
74 * @size_t *nf@, @mp ***f@ = output array for factors
76 * Returns: A Lim-Lee prime, or null if generation failed.
78 * Use: Generates Lim-Lee primes. A Lim-Lee prime %$p$% is one which
79 * satisfies %$p = 2 \prod_i q_i + 1$%, where all of the %$q_i$%
80 * are large enough to resist square-root discrete log
83 * If we succeed, and @f@ is non-null, we write the array of
84 * factors chosen to @f@ for the benefit of the caller.
87 extern mp
*limlee(const char */
*name*/
, mp */
*d*/
, mp */
*newp*/
,
88 unsigned /*ql*/, unsigned /*pl*/, grand */
*r*/
,
89 unsigned /*on*/, pgen_proc */
*oev*/
, void */
*oec*/
,
90 pgen_proc */
*iev*/
, void */
*iec*/
,
91 size_t */
*nf*/
, mp
***/
*f*/
);
93 /*----- That's all, folks -------------------------------------------------*/