/* -*-c-*-
*
- * $Id: dsa.h,v 1.7 2000/07/29 09:59:44 mdw Exp $
+ * $Id: dsa.h,v 1.8 2001/02/03 16:08:24 mdw Exp $
*
* Digital Signature Algorithm
*
/*----- 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.
*
# include "key.h"
#endif
+#ifndef CATACOMB_KEYCHECK_H
+# include "keycheck.h"
+#endif
+
#ifndef CATACOMB_MP_H
# include "mp.h"
#endif
typedef dh_pub dsa_pub;
typedef dh_priv dsa_priv;
+/* --- DSA key seed structure --- */
+
+typedef struct dsa_seed {
+ void *p; /* Pointer to seed material */
+ size_t sz; /* Size of seed material */
+ unsigned count; /* Iterations to find @p@ */
+} dsa_seed;
+
/* --- DSA signature structure --- *
*
* This is the recommended structure for a DSA signature. The actual signing
mp *q; /* Force @p@ to be a multiple */
size_t bits; /* Number of bits in the result */
unsigned or; /* OR mask for low order bits */
+ unsigned count; /* Counts the number of steps made */
+ void *seedbuf; /* Pointer to seed buffer */
} dsa_stepctx;
/* --- @dsa_step@ --- *
* @unsigned steps@ = number of steps to find @q@
* @const void *k@ = pointer to key material
* @size_t sz@ = size of key material
+ * @dsa_seed *sd@ = optional pointer for output seed information
* @pgen_proc *event@ = event handler function
* @void *ectx@ = argument for event handler
*
extern int dsa_gen(dsa_param */*dp*/, unsigned /*ql*/, unsigned /*pl*/,
unsigned /*steps*/, const void */*k*/, size_t /*sz*/,
- pgen_proc */*event*/, void */*ectx*/);
+ dsa_seed */*sd*/, pgen_proc */*event*/, void */*ectx*/);
+
+/* --- @dsa_checkparam@ --- *
+ *
+ * Arguments: @keycheck *kc@ = keycheck state
+ * @const dsa_param *dp@ = pointer to the parameter set
+ * @const dsa_seed *ds@ = pointer to seed information
+ *
+ * Returns: Zero if all OK, or return status from function.
+ *
+ * Use: Checks a set of DSA parameters for consistency and security.
+ */
+
+extern int dsa_checkparam(keycheck */*kc*/, const dsa_param */*dp*/,
+ const dsa_seed */*ds*/);
/* --- @dsa_mksig@ --- *
*