X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/987bb691c9d1fa2b4de1c64e3a6cec7102b91145..b3f050848e5d285c2a1d7f8a4bea98984c201805:/dsa.h diff --git a/dsa.h b/dsa.h index 97f8241..ba3bad8 100644 --- a/dsa.h +++ b/dsa.h @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: dsa.h,v 1.2 1999/11/20 22:23:48 mdw Exp $ + * $Id: dsa.h,v 1.3 1999/12/10 23:29:48 mdw Exp $ * * Digital Signature Algorithm * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: dsa.h,v $ + * 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. * @@ -38,8 +41,8 @@ * */ -#ifndef DSA_H -#define DSA_H +#ifndef CATACOMB_DSA_H +#define CATACOMB_DSA_H #ifdef __cplusplus extern "C" { @@ -56,7 +59,7 @@ /*----- Header files ------------------------------------------------------*/ -#ifndef MP_H +#ifndef CATACOMB_MP_H # include "mp.h" #endif @@ -65,15 +68,18 @@ enum { DSAEV_OK, /* Everything is fine */ + DSAEV_FINDQ, /* Search for a @q@ */ DSAEV_FAILQ, /* @q@ failed primality test */ DSAEV_PASSQ, /* @q@ passeed one iteration */ DSAEV_GOODQ, /* Found good prime @q@ */ + DSAEV_FINDP, /* Search for a @p@ */ DSAEV_TRYP, /* Try prospective @p@ */ DSAEV_FAILP, /* @p@ failed primality test */ DSAEV_PASSP, /* @p@ passed one iteration */ DSAEV_GOODP, /* @p@ accepted as being prime */ + DSAEV_FINDG, /* Search for a @g@ */ DSAEV_TRYH, /* Try prospective @h@ */ DSAEV_FAILH, /* @h@ failed */ DSAEV_GOODG /* @g@ accepted as a generator */ @@ -141,9 +147,9 @@ extern int dsa_seed(dsa_param */*dp*/, unsigned /*l*/, /* --- @dsa_mksig@ --- * * * Arguments: @const dsa_param *dp@ = pointer to DSA parameters - * @const mp *a@ = secret signing key - * @const mp *m@ = message to be signed - * @const mp *k@ = random data + * @mp *a@ = secret signing key + * @mp *m@ = message to be signed + * @mp *k@ = random data * @mp **rr, **ss@ = where to put output parameters * * Returns: --- @@ -151,8 +157,8 @@ extern int dsa_seed(dsa_param */*dp*/, unsigned /*l*/, * Use: Computes a DSA signature of a message. */ -extern void dsa_mksig(const dsa_param */*dp*/, const mp */*a*/, - const mp */*m*/, const mp */*k*/, +extern void dsa_mksig(const dsa_param */*dp*/, mp */*a*/, + mp */*m*/, mp */*k*/, mp **/*rr*/, mp **/*ss*/); /* --- @dsa_sign@ --- * @@ -183,22 +189,22 @@ extern void dsa_sign(dsa_param */*dp*/, mp */*a*/, /* --- @dsa_vrfy@ --- * * * Arguments: @const dsa_param *dp@ = pointer to DSA parameters - * @const mp *y@ = public verification key - * @const mp *m@ = message which was signed - * @const mp *r, *s@ = the signature + * @mp *y@ = public verification key + * @mp *m@ = message which was signed + * @mp *r, *s@ = the signature * * Returns: Zero if the signature is a forgery, nonzero if it's valid. * * Use: Verifies a DSA digital signature. */ -extern int dsa_vrfy(const dsa_param */*dp*/, const mp */*y*/, - const mp */*m*/, const mp */*r*/, const mp */*s*/); +extern int dsa_vrfy(const dsa_param */*dp*/, mp */*y*/, + mp */*m*/, mp */*r*/, mp */*s*/); /* --- @dsa_verify@ --- * * * Arguments: @const dsa_param *dp@ = pointer to DSA parameters - * @const mp *y@ = public verification key + * @mp *y@ = public verification key * @const void *m@ = pointer to message block * @size_t msz@ = size of message block * @const void *r@ = pointer to @r@ signature half @@ -211,7 +217,7 @@ extern int dsa_vrfy(const dsa_param */*dp*/, const mp */*y*/, * Use: Verifies a DSA digital signature. */ -extern int dsa_verify(const dsa_param */*dp*/, const mp */*y*/, +extern int dsa_verify(const dsa_param */*dp*/, mp */*y*/, const void */*m*/, size_t /*msz*/, const void */*r*/, size_t /*rsz*/, const void */*s*/, size_t /*ssz*/);