CryptoSys PQC  1.0.0
Public Types | Static Public Member Functions | List of all members
crsyspqc::Rng Class Reference

Random Number Generator to NIST SP800-90. More...

Public Types

enum  Opts : unsigned int
 Rng options More...
 

Static Public Member Functions

static bvec_t Bytes (int n)
 Generate an array of random bytes. More...
 
static int Initialize (const std::string &seedFile)
 Initialize the RNG generator using a seed file. More...
 
static int InitializeEx (Opts opts=Opts::Default)
 Query and initialize the RNG generator using Intel(R) DRNG, if available. More...
 

Detailed Description

Random Number Generator to NIST SP800-90.

Member Enumeration Documentation

◆ Opts

enum crsyspqc::Rng::Opts : unsigned int

Rng options

Enumerator
Default 

Default options.

NoIntelDrng 

Turn off support for INTEL(R) DRNG for the current session.

Member Function Documentation

◆ Bytes()

static bvec_t crsyspqc::Rng::Bytes ( int  n)
static

Generate an array of random bytes.

Parameters
nRequired number of random bytes
Returns
Array of random bytes

◆ Initialize()

static int crsyspqc::Rng::Initialize ( const std::string &  seedFile)
static

Initialize the RNG generator using a seed file.

Parameters
seedFileFull path name of seed file.
Returns
Zero on success.
Remarks
If the seed file does not exist, it will be created. If it exists, it will be automatically updated with more entropy.

◆ InitializeEx()

static int crsyspqc::Rng::InitializeEx ( Opts  opts = Opts::Default)
static

Query and initialize the RNG generator using Intel(R) DRNG, if available.

Parameters
optsOption flags (optional)
Returns
Support status for Intel(R) DRNG. If available, then returns a positive value 1 or greater; else a negative error code.
Remarks
Use the Rng.Opts.NoIntelDrng option if for some reason it is interfering with your application.
Copyright (C) 2024-25 D.I. Management Services Pty Limited t/a CryptoSys ABN 78 083 210 584 Australia. All rights reserved. <www.di-mgt.com.au> <www.cryptosys.net>. Generated on Sat May 24 2025 20:58:07 by Doxygen 1.9.1.