3 * $Id: dh.h,v 1.2 1999/12/10 23:29:48 mdw Exp $
5 * [Diffie-Hellman key negotiation *
6 * (c) 1999 Straylight/Edgeware
9 /*----- Licensing notice --------------------------------------------------*
11 * This file is part of Catacomb.
13 * Catacomb is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU Library General Public License as
15 * published by the Free Software Foundation; either version 2 of the
16 * License, or (at your option) any later version.
18 * Catacomb is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Library General Public License for more details.
23 * You should have received a copy of the GNU Library General Public
24 * License along with Catacomb; if not, write to the Free
25 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
29 /*----- Revision history --------------------------------------------------*
32 * Revision 1.2 1999/12/10 23:29:48 mdw
33 * Change header file guard names.
35 * Revision 1.1 1999/11/20 22:24:44 mdw
36 * Add Diffie-Hellman support.
47 /*----- Header files ------------------------------------------------------*/
53 /*----- Event codes -------------------------------------------------------*/
62 /*----- Functions provided ------------------------------------------------*/
64 /* --- @dh_prime@ --- *
66 * Arguments: @mp *s@ = start point for search (must be odd)
67 * @size_t n@ = number of concerted attempts to make, or zero
68 * @void (*proc)(int ev, void *p)@ = event handler
69 * @void *p@ = argument for event handler
71 * Returns: A prime number %$p$% where %$p = 2q + 1$% for prime %$q$%.
73 * Use: Finds a safe prime by sequential search from a given starting
74 * point. If it fails, a null pointer is returned.
76 * The event handler is informed of the progress of the search.
77 * It may abort the search at any time by returning a nonzero
81 extern mp
*dh_prime(mp */
*s*/
, size_t /*n*/,
82 int (*proc
)(int /*ev*/, void */
*p*/
), void */
*p*/
);
84 /*----- That's all, folks -------------------------------------------------*/