Added default constructor and a reset() method
private TranscriptStream tOut = new TranscriptStream();
private int index = 0;
+ /**
+ * Default constructor that takes an arbitrary SecureRandom as initial random
+ */
+ public JournalingSecureRandom() {
+
+ this(new SecureRandom());
+
+ }
+
/**
* Base constructor - no prior transcript.
*
@@ -103,6 +112,15 @@ public void clear()
tOut.clear();
}
+ /**
+ * Resets the index to zero such that the randomness will now be reused
+ */
+ public void reset() {
+
+ index = 0;
+
+ }
+
/**
* Return the transcript so far,
*
