Cryptography Reference
In-Depth Information
Function:
initialization of the AES pseudorandom number generator
and production of entropy
Syntax:
int
InitRandAES_l (STATEAES *rstate, char *UsrStr,
int LenUsrStr, int AddEntropy, int update);
rstate (pointer to state memory)
UsrStr (pointer to user character string)
LenUsrStr (length of user string in bytes)
AddEntropy (number of additional requested entropy bytes)
update (frequency of the AES key update)
Input:
rstate (pointer to initialized state memory)
Ouput:
Return:
0 if all O.K.
n> 0 : number of requested but not generated entropy bytes
int
InitRandAES_l (STATEAES *rstate, char *UsrStr, int LenUsrStr,
int AddEntropy, int update)
{
int MissingEntropy, i;
Generation of the start value. In MissingEntropy is stored how many of the
requested entropy bytes were unavailable.
MissingEntropy = GetEntropy_l (NULL, rstate->XAES, AddEntropy,
UsrStr, LenUsrStr);
Initialization of AES.
for (i = 0; i < 32; i++)
{
rstate->RandAESKey[i] ˆ = RandAESKey[i];
}
AESInit_l (&rstate->RandAESWorksp, AES_ECB, 192, NULL,
&rstate->RandAESSched, rstate->RandAESKey, 256, AES_ENC);
First state change, creation of start state
 
Search WWH ::




Custom Search