Give generic random objects separate namespaces for their supported misc
authormdw <mdw>
Sat, 3 Feb 2001 16:07:33 +0000 (16:07 +0000)
committermdw <mdw>
Sat, 3 Feb 2001 16:07:33 +0000 (16:07 +0000)
ops.

bbs.h
grand.h
rand.h

diff --git a/bbs.h b/bbs.h
index 7217f65..b83b87f 100644 (file)
--- a/bbs.h
+++ b/bbs.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: bbs.h,v 1.5 2000/07/01 11:20:24 mdw Exp $
+ * $Id: bbs.h,v 1.6 2001/02/03 16:07:33 mdw Exp $
  *
  * The Blum-Blum-Shub random bit generator
  *
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: bbs.h,v $
+ * Revision 1.6  2001/02/03 16:07:33  mdw
+ * Give generic random objects separate namespaces for their supported misc
+ * ops.
+ *
  * Revision 1.5  2000/07/01 11:20:24  mdw
  * New functions for freeing public and private keys.  Remove bad type name
  * `bbs_param'.
@@ -305,7 +309,7 @@ extern grand *bbs_rand(mp */*m*/, mp */*x*/);
 /* --- Blum-Blum-Shub-specific misc op codes --- */
 
 enum {
-  BBS_SET = GRAND_SPECIFIC             /* @mp *x@ */
+  BBS_SET = GRAND_SPECIFIC('B')                /* @mp *x@ */
 };
 
 /*----- That's all, folks -------------------------------------------------*/
diff --git a/grand.h b/grand.h
index 54083d2..7b6fdbb 100644 (file)
--- a/grand.h
+++ b/grand.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: grand.h,v 1.2 2000/06/17 11:23:11 mdw Exp $
+ * $Id: grand.h,v 1.3 2001/02/03 16:07:33 mdw Exp $
  *
  * Generic interface to random number generators
  *
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: grand.h,v $
+ * Revision 1.3  2001/02/03 16:07:33  mdw
+ * Give generic random objects separate namespaces for their supported misc
+ * ops.
+ *
  * Revision 1.2  2000/06/17 11:23:11  mdw
  * Typesetting fix.  Add a flags word to the generic generator.
  *
@@ -105,11 +109,11 @@ enum {
   GRAND_SEEDUINT32,                    /* @uint32 i@ */
   GRAND_SEEDBLOCK,                     /* @const void *p, size_t sz@ */
   GRAND_SEEDMP,                                /* @mp *m@ */
-  GRAND_SEEDRAND,                      /* @grand *g@ */
+  GRAND_SEEDRAND                       /* @grand *g@ */
 
   /* --- Generator-specific operations --- */
 
-  GRAND_SPECIFIC = 256u
+#define GRAND_SPECIFIC(ch) ((unsigned)(ch) << 8) 
 };
 
 #define GRAND_BADOP assert(((void)"bad grand_misc op", 0))
diff --git a/rand.h b/rand.h
index 6dbd021..05721fc 100644 (file)
--- a/rand.h
+++ b/rand.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: rand.h,v 1.7 2000/10/08 12:07:18 mdw Exp $
+ * $Id: rand.h,v 1.8 2001/02/03 16:07:33 mdw Exp $
  *
  * Secure random number generator
  *
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: rand.h,v $
+ * Revision 1.8  2001/02/03 16:07:33  mdw
+ * Give generic random objects separate namespaces for their supported misc
+ * ops.
+ *
  * Revision 1.7  2000/10/08 12:07:18  mdw
  * Remove spurious comma in enum.
  *
@@ -306,7 +310,7 @@ extern void rand_getgood(rand_pool */*r*/, void */*p*/, size_t /*sz*/);
 /* --- Miscellaneous operations --- */
 
 enum {
-  RAND_GATE = GRAND_SPECIFIC,          /* No args */
+  RAND_GATE = GRAND_SPECIFIC('R'),     /* No args */
   RAND_STRETCH,                                /* No args */
   RAND_KEY,                            /* @const void *k, size_t sz@ */
   RAND_NOISESRC,                       /* @const rand_source *s@ */