CryptoSys PKI Toolkit Manual

RNG_Test

Carries out a NIST SP800-90 health check and FIPS140-2 statistical tests on the random number generator.

VB6/VBA Syntax

Public Declare Function RNG_Test Lib "diCrPKI.dll" (ByVal strFileName As String, ByVal nOptions As Long) As Long

nRet = RNG_Test(strFileName, nOptions)

Parameters

strFileName
[in] String (optional) specifying the test output file to be created.
nOptions
[in] Long option flags: not used in this release. Specify zero.

C/C++ Syntax

long _stdcall RNG_Test(const char *szFileName, long nOptions);

Returns (VB6/C)

Long: If successful, the return value is zero; otherwise it returns a nonzero error code.

.NET Equivalent

Rng.Test Method

Remarks

This function carries out, on demand, the health testing procedure from section 11.3 of [SP80090] and the statistical tests for randomness from section 4.9.1 of the October 2001 version of FIPS-140-2 [FIPS140]. The statistical test results and the 20,000 bit sample are written to a text file. Specify an empty ("") or NULL strFileName to avoid creating an output file and just carry out the tests. The statistical tests have since been removed from FIPS-140-2, but we do them anyway. If any tests fail, a nonzero error code will be returned.

Example

Dim strFileName As String
Dim nRet As Long

strFileName = "pkiFips140.txt"
nRet = RNG_Test(strFileName, 0)
Debug.Print "RNG_Test('" & strFileName & "') returns " & nRet & " (expecting 0)"

See Also

RNG_Initialize

[Contents] [Index]

[HOME]   [NEXT: RNG_UpdateSeedFile...]

Copyright © 2004-12 D.I. Management Services Pty Ltd. All rights reserved.