1 | PRN data | Output | Char(*) |
2 | PRN data length | Input | Binary(4) |
3 | PRN type | Input | Char(1) |
4 | PRN Parity | Input | Char(1) |
5 | Error code | I/O | Char(*) |
The Generate Pseudorandom Numbers (OPM, QC3GENRN; ILE, Qc3GenPRNs) API generates a pseudorandom binary stream.
The pseudorandom number generator is composed of two parts: pseudorandom number generation and seed management. Pseudorandom number generation is performed using the FIPS 186-1 algorithm. Cryptographically-secure pseudorandom numbers rely on good seed. The FIPS 186-1 key and seed values are obtained from the system seed digest. The server automatically generates seed using data collected from system information or by using the random number generator function on a cryptographic coprocessor, such as a 4758, if one is available. System-generated seed can never be truly unpredictable. If a cryptographic coprocessor is not available, you can use the Add Seed for PRNG (Qc3AddPRNGSeed) API to add your own random seed to the system seed digest. This should be done as soon as possible any time the Licensed Internal Code is installed.
None.
The generated pseudorandom binary stream.
The number of pseudorandom number bytes to return in the PRN data parameter. If 0 is specified, no pseudorandom numbers are returned.
The API can generate a real pseudorandom binary stream or a test binary stream.
The FIPS 186-1 algorithm obtains the inital key and seed values from the system seed digest when generating a real pseudorandom binary stream. When generating a test binary stream, the algorithm uses preset values for the key and seed. Valid values are:
0 | Generate real pseudorandom numbers. |
1 | Generate test pseudorandom numbers. |
The API sets each byte of the pseudorandom number binary stream to the specified parity by altering the low order bit in each byte as necessary. Valid values are:
0 | Do not set parity. |
1 | Set each byte to odd parity. |
2 | Set each byte to even parity. |
The structure in which to return error information. For the format of the structure, see Error Code Parameter.
Message ID | Error Message Text |
---|---|
CPF3C19 E | Error occurred with receiver variable specified. |
CPF3CF1 E | Error code parameter not valid. |
CPFBAF1 E | PRN type not valid. |
CPFBAF2 E | Parity not valid. |
CPFBAF3 E | The system seed digest is not ready. |
Top | Miscellaneous APIs | APIs by category |