chiark / gitweb /
Add some more vectors, and a whinge about how Skipjack test vectors are.
[catacomb] / limlee.h
1 /* -*-c-*-
2  *
3  * $Id: limlee.h,v 1.1 2000/07/09 21:30:58 mdw Exp $
4  *
5  * Generate Lim-Lee primes
6  *
7  * (c) 2000 Straylight/Edgeware
8  */
9
10 /*----- Licensing notice --------------------------------------------------* 
11  *
12  * This file is part of Catacomb.
13  *
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.
18  * 
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.
23  * 
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,
27  * MA 02111-1307, USA.
28  */
29
30 /*----- Revision history --------------------------------------------------* 
31  *
32  * $Log: limlee.h,v $
33  * Revision 1.1  2000/07/09 21:30:58  mdw
34  * Lim-Lee prime generation.
35  *
36  */
37
38 #ifndef CATACOMB_LIMLEE_H
39 #define CATACOMB_LIMLEE_H
40
41 #ifdef __cplusplus
42   extern "C" {
43 #endif
44
45 /*----- Header files ------------------------------------------------------*/
46
47 #ifndef CATACOMB_GRAND_H
48 #  include "grand.h"
49 #endif
50
51 #ifndef CATACOMB_MP_H
52 #  include "mp.h"
53 #endif
54
55 #ifndef CATACOMB_PGEN_H
56 #  include "pgen.h"
57 #endif
58
59 /*----- Functions provided ------------------------------------------------*/
60
61 /* --- @limlee@ --- *
62  *
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
75  *
76  * Returns:     A Lim-Lee prime, or null if generation failed.
77  *
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
81  *              algorithms.
82  *
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.
85  */
86
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*/);
92
93 /*----- That's all, folks -------------------------------------------------*/
94
95 #ifdef __cplusplus
96   }
97 #endif
98
99 #endif