public class FIPS140Test
extends java.lang.Object
First generate a FIPS140Test object passing an instance of the Random object
to be tested. Then, either call startTests()
to conduct all the
tests or call the individual tests yourself. You must first have the random
bits generated by calling initTests()
, startTests()
does that automatically each time you call it.
NOTE: This *may* crash on the Symantec Visual Cafe 2.1 JIT, but it works fine with 2.5.
Constructor and Description |
---|
FIPS140Test(java.io.InputStream randStream)
Creates a FIPS140Test object that reads the data to be examined from the
given stream.
|
FIPS140Test(java.util.Random random)
Creates a FIPS140Test object that examines the given Random object.
|
Modifier and Type | Method and Description |
---|---|
void |
initTests()
Init the tests by generating the necessary amount of test data (20000
bits).
|
boolean |
longRunsTest()
Run the long runs test.
|
boolean |
monoBitTest()
Run the monobit test.
|
boolean |
pokerTest()
Run the poker test.
|
boolean |
runsTest()
Run the runs test.
|
boolean |
runTests()
Deprecated.
use startTests() instead.
|
void |
setDebugStream(java.io.PrintStream debugStream)
Send debug output to the given stream.
|
void |
setDebugStream(java.io.PrintWriter debugStream)
Send debug output to the given writer.
|
boolean |
startTests()
Run all the tests.
|
boolean |
startTests(boolean forceAll)
Always run all the tests.
|
public FIPS140Test(java.util.Random random)
public FIPS140Test(java.io.InputStream randStream)
public void setDebugStream(java.io.PrintStream debugStream)
public void setDebugStream(java.io.PrintWriter debugStream)
public boolean monoBitTest()
public boolean runsTest()
public boolean longRunsTest()
public boolean pokerTest()
public void initTests() throws RandomException
RandomException
- if there was an error reading the datapublic boolean runTests()
public boolean startTests()
public boolean startTests(boolean forceAll)
forceAll
is true, this method
will continue to run the tests even if an earlier test already failed.
Otherwise it will return false as soon as one test failed.