Cryptography Reference
In-Depth Information
Function:
initialization of the Blum-Blum-Shub pseudorandom
number generator including obtaining entropy
Syntax:
int
InitRandBBS_l (STATEBBS *rstate, char * UsrStr,
int LenUsrStr, int AddEntropy);
rstate (pointer to state memory)
UsrStr (pointer to user character string)
LenUsrStr (length of the user string in bytes)
AddEntropy (number of additional requested entropy bytes)
Input:
rstate (pointer to initialized state memory)
Output:
Return:
0 if all O.K.
n> 0 : number of requested but not generated bytes
int
InitRandBBS_l (STATEBBS *rstate, char *UsrStr, int LenUsrStr, int AddEntropy)
{
CLINT Seed_l;
int MissingEntropy;
Generation of the requested entropy and from that the start value
MissingEntropy = GetEntropy_l (Seed_l, NULL, AddEntropy, UsrStr, LenUsrStr);
Generation of the internal start state
SeedBBS_l (rstate, Seed_l);
Deletion of the start value by overwriting
local_memset (Seed_l, 0, sizeof (CLINT));
return MissingEntropy;
}
The actual initialization of the generator is accomplished by the function
seedBBS_l :
 
Search WWH ::




Custom Search