X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/702c8f086be6e11a2b93f66645a1c590b673dc70..59919ae4b1721ca271c3d3e5955c09d322573821:/dsarand.c diff --git a/dsarand.c b/dsarand.c index 146a20f..4f12b98 100644 --- a/dsarand.c +++ b/dsarand.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: dsarand.c,v 1.2 2000/06/17 10:54:00 mdw Exp $ + * $Id: dsarand.c,v 1.3 2001/02/03 16:08:56 mdw Exp $ * * Random number generator for DSA * @@ -30,6 +30,10 @@ /*----- Revision history --------------------------------------------------* * * $Log: dsarand.c,v $ + * Revision 1.3 2001/02/03 16:08:56 mdw + * Give generic random objects separate namespaces for their supported misc + * ops. Add operations for reading the current seed value. + * * Revision 1.2 2000/06/17 10:54:00 mdw * Typesetting fixes. Arena support. * @@ -277,6 +281,8 @@ static int gmisc(grand *r, unsigned op, ...) case GRAND_SEEDBLOCK: case GRAND_SEEDRAND: case DSARAND_PASSES: + case DSARAND_SEEDSZ: + case DSARAND_GETSEED: rc = 1; break; default: @@ -296,6 +302,12 @@ static int gmisc(grand *r, unsigned op, ...) case DSARAND_PASSES: g->d.passes = va_arg(ap, unsigned); break; + case DSARAND_SEEDSZ: + rc = g->d.sz; + break; + case DSARAND_GETSEED: + memcpy(va_arg(ap, void *), g->d.p, g->d.sz); + break; default: GRAND_BADOP; break;