aboutsummaryrefslogtreecommitdiffstats
path: root/src/rng
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-10-28 18:12:58 +0000
committerlloyd <[email protected]>2008-10-28 18:12:58 +0000
commit104795c6735256c293976d428a35657cdb46629a (patch)
tree02a64afbea97547b3dd20caa8bf3ee696e3cbf07 /src/rng
parent6297fa41813ab9d8951f6469bd9d7336ba873f8a (diff)
In HMAC_RNG, force a reseed after 8192 blocks
Diffstat (limited to 'src/rng')
-rw-r--r--src/rng/hmac_rng/hmac_rng.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rng/hmac_rng/hmac_rng.cpp b/src/rng/hmac_rng/hmac_rng.cpp
index c60a732b5..1a9fedb6c 100644
--- a/src/rng/hmac_rng/hmac_rng.cpp
+++ b/src/rng/hmac_rng/hmac_rng.cpp
@@ -97,6 +97,9 @@ void HMAC_RNG::randomize(byte out[], u32bit length)
out += copied;
length -= copied;
+
+ if(counter >= 8192)
+ reseed();
}
}