Cryptography Reference
In-Depth Information
specialized to a specific random number generator. Rather, the choice of the
generator to use is supported by a parameter. Here it is necessary to pass the
appropriate state memory as parameter. The structure
struct InternalStatePRNG
{
STATERMDSHA1 StateRMDSHA1;
STATEAES StateAES;
STATEBBS StateBBS;
int Generator;
};
extended by setting
typedef struct InternalStatePRNG STATEPRNG;
contains the state memory of the individual random number generators
previously presented as well as the status variable
Generator
, which specifies for
which random number generator the structure was initialized.
With this definition, the functions
InitRand_l()
,
Rand_l()
,
lRand_l()
,
sRand_l()
,
bRand_l()
,and
PurgeRand_l()
were created. With
InitRand_l()
a
generator is initialized that is then used for subsequent calls of the random
functions. The random functions themselves require as parameter a pointer to
the initialized structure
STATEPRNG
.