From c2696bba005158be01266946a3006ee4361ceb25 Mon Sep 17 00:00:00 2001 From: duck Date: Wed, 25 May 2005 21:32:38 +0000 Subject: [PATCH] 2005-05-25 duck * Fixed PRNG bug (bugzilla #107) --- core/java/src/net/i2p/util/PooledRandomSource.java | 6 ++++-- history.txt | 5 ++++- router/java/src/net/i2p/router/RouterVersion.java | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/core/java/src/net/i2p/util/PooledRandomSource.java b/core/java/src/net/i2p/util/PooledRandomSource.java index 21cf4f514..8011a5350 100644 --- a/core/java/src/net/i2p/util/PooledRandomSource.java +++ b/core/java/src/net/i2p/util/PooledRandomSource.java @@ -34,7 +34,9 @@ public class PooledRandomSource extends RandomSource { } private final RandomSource pickPRNG() { - return _pool[(_nextPool++) % POOL_SIZE]; + int i = _nextPool; + _nextPool = (_nextPool++) % POOL_SIZE; + return _pool[i]; } /** @@ -138,4 +140,4 @@ public class PooledRandomSource extends RandomSource { RandomSource prng = pickPRNG(); return prng.harvester(); } -} \ No newline at end of file +} diff --git a/history.txt b/history.txt index dbf2dc447..66fc50dd8 100644 --- a/history.txt +++ b/history.txt @@ -1,4 +1,7 @@ -$Id: history.txt,v 1.204 2005/05/01 12:21:50 jrandom Exp $ +$Id: history.txt,v 1.205 2005/05/01 21:35:16 jrandom Exp $ + +2005-05-25 duck + * Fixed PRNG bug (bugzilla #107) 2005-05-01 jrandom * Added a substantial optimization to the AES engine by caching the diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 51f1100b7..b9fe469fd 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -15,9 +15,9 @@ import net.i2p.CoreVersion; * */ public class RouterVersion { - public final static String ID = "$Revision: 1.195 $ $Date: 2005/05/01 12:21:49 $"; + public final static String ID = "$Revision: 1.196 $ $Date: 2005/05/01 21:35:16 $"; public final static String VERSION = "0.5.0.7"; - public final static long BUILD = 7; + public final static long BUILD = 8; public static void main(String args[]) { System.out.println("I2P Router version: " + VERSION); System.out.println("Router ID: " + RouterVersion.ID);