projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simple (non-projective) curves over prime fields now seem to work.
[u/mdw/catacomb]
/
grand.h
diff --git
a/grand.h
b/grand.h
index
54083d2
..
160663e
100644
(file)
--- a/
grand.h
+++ b/
grand.h
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: grand.h,v 1.
2 2000/06/17 11:23:11
mdw Exp $
+ * $Id: grand.h,v 1.
4 2001/04/19 18:23:53
mdw Exp $
*
* Generic interface to random number generators
*
*
* Generic interface to random number generators
*
@@
-30,6
+30,13
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: grand.h,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: grand.h,v $
+ * Revision 1.4 2001/04/19 18:23:53 mdw
+ * Use unsigned integer rather than enum for flags.
+ *
+ * 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.
*
* Revision 1.2 2000/06/17 11:23:11 mdw
* Typesetting fix. Add a flags word to the generic generator.
*
@@
-87,9
+94,7
@@
typedef struct grand_ops {
/* --- Flag types --- */
/* --- Flag types --- */
-enum {
- GRAND_CRYPTO = 1u /* Cryptographically strong */
-};
+#define GRAND_CRYPTO 1u /* Cryptographically strong */
/* --- Operation types --- */
/* --- Operation types --- */
@@
-105,11
+110,11
@@
enum {
GRAND_SEEDUINT32, /* @uint32 i@ */
GRAND_SEEDBLOCK, /* @const void *p, size_t sz@ */
GRAND_SEEDMP, /* @mp *m@ */
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 --- */
/* --- Generator-specific operations --- */
- GRAND_SPECIFIC = 256u
+#define GRAND_SPECIFIC(ch) ((unsigned)(ch) << 8)
};
#define GRAND_BADOP assert(((void)"bad grand_misc op", 0))
};
#define GRAND_BADOP assert(((void)"bad grand_misc op", 0))