|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--iaik.security.random.FIPS140Test
This class tests a Random number generator for randomness using statstical tests as defined in FIPS 140-1. Note that this is a statistical test only, it does not say anything about the predictability (and hence cryptographic strength) of a random number generator. FIPS 140-1 specifies four tests that are to be performed on 20000 bits of pseudo random output.
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 Summary | |
FIPS140Test(InputStream randStream)
Creates a FIPS140Test object that reads the data to be examined from the given stream. |
|
FIPS140Test(Random random)
Creates a FIPS140Test object that examines the given Random object. |
Method Summary | |
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(PrintStream debugStream)
Send debug output to the given stream. |
void |
setDebugStream(PrintWriter debugStream)
Send debug output to the given writer. |
boolean |
startTests()
Run all the tests. |
boolean |
startTests(boolean forceAll)
Always run all the tests. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FIPS140Test(Random random)
public FIPS140Test(InputStream randStream)
Method Detail |
public void setDebugStream(PrintStream debugStream)
public void setDebugStream(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.
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |