projects
/
u
/
mdw
/
catacomb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9219a5d
)
Amend the notes slightly.
author
mdw
<mdw>
Sat, 17 Jun 2000 11:28:51 +0000
(11:28 +0000)
committer
mdw
<mdw>
Sat, 17 Jun 2000 11:28:51 +0000
(11:28 +0000)
lcrand.h
patch
|
blob
|
blame
|
history
diff --git
a/lcrand.h
b/lcrand.h
index
24429c6
..
a8128dd
100644
(file)
--- a/
lcrand.h
+++ b/
lcrand.h
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: lcrand.h,v 1.
1 1999/12/10 23:15:27
mdw Exp $
+ * $Id: lcrand.h,v 1.
2 2000/06/17 11:28:51
mdw Exp $
*
* Simple linear congruential generator
*
*
* Simple linear congruential generator
*
@@
-30,18
+30,14
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: lcrand.h,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: lcrand.h,v $
+ * Revision 1.2 2000/06/17 11:28:51 mdw
+ * Amend the notes slightly.
+ *
* Revision 1.1 1999/12/10 23:15:27 mdw
* Noncryptographic random number generator.
*
*/
* Revision 1.1 1999/12/10 23:15:27 mdw
* Noncryptographic random number generator.
*
*/
-#ifndef CATACOMB_LCRAND_H
-#define CATACOMB_LCRAND_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
/*----- Notes on the linear congruential generator ------------------------*
*
* This pseudorandom number generator is simple, but has absolutely no
/*----- Notes on the linear congruential generator ------------------------*
*
* This pseudorandom number generator is simple, but has absolutely no
@@
-49,7
+45,10
@@
* are required but cryptographic strength is not, for example when
* generating numbers for use in primality tests. To be honest, it's not
* even particularly fast, although a certain amount of effort has been
* are required but cryptographic strength is not, for example when
* generating numbers for use in primality tests. To be honest, it's not
* even particularly fast, although a certain amount of effort has been
- * expended on making it better than awfully slow.
+ * expended on making it better than awfully slow. To put things in
+ * perspective, it can't quite spit bytes out as fast as OFB DES. (Then
+ * again, bytes aren't its natural output format.) Its main use is probably
+ * seeding a Fibonacci generator.
*
* There exists a fixed-point input @LCRAND_FIXEDPT@ -- when fed to the
* generator it comes straight back out again. All other inputs less than
*
* There exists a fixed-point input @LCRAND_FIXEDPT@ -- when fed to the
* generator it comes straight back out again. All other inputs less than
@@
-65,6
+64,13
@@
* The fixed point value is determined as %$c / (1 - a) \bmod p$%.
*/
* The fixed point value is determined as %$c / (1 - a) \bmod p$%.
*/
+#ifndef CATACOMB_LCRAND_H
+#define CATACOMB_LCRAND_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
/*----- Header files ------------------------------------------------------*/
#include <mLib/bits.h>
/*----- Header files ------------------------------------------------------*/
#include <mLib/bits.h>