aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/x931_rng.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/x931_rng.cpp b/src/x931_rng.cpp
index ee21d480e..01b8c33d2 100644
--- a/src/x931_rng.cpp
+++ b/src/x931_rng.cpp
@@ -29,10 +29,7 @@ void ANSI_X931_RNG::randomize(byte out[], u32bit length) throw(PRNG_Unseeded)
position += copied;
if(position == R.size())
- {
update_buffer();
- position = 0;
- }
}
}
@@ -53,6 +50,8 @@ void ANSI_X931_RNG::update_buffer()
xor_buf(V, R, DT, BLOCK_SIZE);
cipher->encrypt(V);
+
+ position = 0;
}
/*************************************************