CryptoSys PKI Pro Manual

RNG_Test

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

VBA/VB6 Syntax

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

nRet = RNG_Test(strFileName, nOptions)

C/C++ Syntax

long __stdcall RNG_Test(const char *szFileOut, long nOptions);

Parameters

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

Returns (VBA/C)

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 [SP80090A] 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 szFileName 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]

[PREV: RNG_StringWithPrompt...]   [Contents]   [Index]   
   [NEXT: RNG_TestDRBGVS...]

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.