/* -*-c-*-
*
- * $Id: grand.h,v 1.1 1999/12/10 23:16:01 mdw Exp $
+ * $Id: grand.h,v 1.2 2000/06/17 11:23:11 mdw Exp $
*
* Generic interface to random number generators
*
/*----- Revision history --------------------------------------------------*
*
* $Log: grand.h,v $
+ * Revision 1.2 2000/06/17 11:23:11 mdw
+ * Typesetting fix. Add a flags word to the generic generator.
+ *
* Revision 1.1 1999/12/10 23:16:01 mdw
* Generic interface.
*
/* --- Various important properties --- */
const char *name; /* Generator's name */
+ unsigned f; /* Various flags */
uint32 max; /* Maximum raw output */
/* --- Maintenance methods --- */
*/
uint32 (*raw)(grand */*r*/); /* Uniform over %$[0, max)$% */
- octet (*byte)(grand */*r*/); /* Uniform over %$[0, 256)%$ */
+ octet (*byte)(grand */*r*/); /* Uniform over %$[0, 256)$% */
uint32 (*word)(grand */*r*/); /* Uniform over %$[0, 2^{32})$% */
uint32 (*range)(grand */*r*/, uint32 /*l*/); /* Uniform over %$[0, l)$% */
void (*fill)(grand */*r*/, void */*p*/, size_t /*sz*/); /* Fill buffer */
} grand_ops;
+/* --- Flag types --- */
+
+enum {
+ GRAND_CRYPTO = 1u /* Cryptographically strong */
+};
+
/* --- Operation types --- */
enum {