X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/600127f0c8669936093fc6bddda5a2dcb59cd076..42ca150ce7fa024a8fd6a4c9433b613175270eb4:/dsa.h diff --git a/dsa.h b/dsa.h index ce7e762..43ff845 100644 --- a/dsa.h +++ b/dsa.h @@ -1,13 +1,13 @@ /* -*-c-*- * - * $Id: dsa.h,v 1.8 2001/02/03 16:08:24 mdw Exp $ + * $Id: dsa.h,v 1.9 2004/04/08 01:36:15 mdw Exp $ * * Digital Signature Algorithm * * (c) 1999 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Catacomb. * @@ -15,47 +15,18 @@ * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. - * + * * Catacomb is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. - * + * * You should have received a copy of the GNU Library General Public * License along with Catacomb; if not, write to the Free * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: dsa.h,v $ - * Revision 1.8 2001/02/03 16:08:24 mdw - * Add consistency checking for public keys. - * - * Revision 1.7 2000/07/29 09:59:44 mdw - * Share data structures with Diffie-Hellman stuff. - * - * Revision 1.6 2000/07/01 11:20:51 mdw - * New functions for freeing public and private keys. - * - * Revision 1.5 2000/06/17 10:53:42 mdw - * Minor changes for key fetching. Typesetting fixes. - * - * Revision 1.4 1999/12/22 15:52:44 mdw - * Reworking for new prime-search system. - * - * Revision 1.3 1999/12/10 23:29:48 mdw - * Change header file guard names. - * - * Revision 1.2 1999/11/20 22:23:48 mdw - * Allow event handler to abort the search process. - * - * Revision 1.1 1999/11/19 19:28:00 mdw - * Implementation of the Digital Signature Algorithm. - * - */ - #ifndef CATACOMB_DSA_H #define CATACOMB_DSA_H @@ -89,7 +60,7 @@ #ifndef CATACOMB_MP_H # include "mp.h" #endif - + #ifndef CATACOMB_PGEN_H # include "pgen.h" #endif @@ -159,7 +130,7 @@ typedef struct dsa_stepctx { * divisibility by small primes. */ -extern int dsa_step(int /*rq*/, pgen_event */*ev*/, void */*p*/); +extern pgen_proc dsa_step; /*----- Functions provided ------------------------------------------------*/ @@ -205,6 +176,22 @@ extern int dsa_gen(dsa_param */*dp*/, unsigned /*ql*/, unsigned /*pl*/, extern int dsa_checkparam(keycheck */*kc*/, const dsa_param */*dp*/, const dsa_seed */*ds*/); +/* --- @dsa_h2n@ --- * + * + * Arguments: @mp *d@ = destination integer + * @mp *r@ = order of the DSA group + * @const void *h@ = pointer to message hash + * @size_t hsz@ = size (in bytes) of the hash output + * + * Returns: Resulting integer. + * + * Use: Converts a hash to an integer in the demented way necessary + * for DSA/ECDSA. This is, of course, completely insane, but + * there you go. + */ + +extern mp *dsa_h2n(mp */*d*/, mp */*r*/, const void */*h*/, size_t /*hsz*/); + /* --- @dsa_mksig@ --- * * * Arguments: @const dsa_param *dp@ = pointer to DSA parameters