summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-12-21 14:32:53 -0800
committerKaz Kylheku <kaz@kylheku.com>2011-12-21 14:32:53 -0800
commit13a8820a0979787bd16f530a400da69c798e954e (patch)
tree11ce45249c04ba37fa13ae965a1220be810dba5d
parent28a3dc321c180dd708867406d3c2c5cc45b586e4 (diff)
downloadtxr-13a8820a0979787bd16f530a400da69c798e954e.tar.gz
txr-13a8820a0979787bd16f530a400da69c798e954e.tar.bz2
txr-13a8820a0979787bd16f530a400da69c798e954e.zip
* rand.c: Added comment about source of algorithm.
-rw-r--r--ChangeLog4
-rw-r--r--rand.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2e9563e7..3407d652 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2011-12-21 Kaz Kylheku <kaz@kylheku.com>
+ * rand.c: Added comment about source of algorithm.
+
+2011-12-21 Kaz Kylheku <kaz@kylheku.com>
+
* rand.c (random): Bugfix: not building up sufficiently large bignums.
Work properly when mp_digit is smaller than 32 bits.
diff --git a/rand.c b/rand.c
index e8d52965..0b811b9f 100644
--- a/rand.c
+++ b/rand.c
@@ -49,6 +49,10 @@ typedef unsigned int rand32_t;
typedef unsigned long rand32_t;
#endif
+/*
+ * The algorithm here is WELL 512.
+ * (Francois Panneton, Pierre L'Ecuyer.)
+ */
struct random_state {
rand32_t state[16];
int cur;