Cryptography Reference
In-Depth Information
Function:
initialization of the RIPEMD-160/SHA-1 pseudorandom
number generator together with entropy creation
Syntax:
int
InitRandRMDSHA1_l (STATERMDSHA1 *rstate, char * UsrStr,
int LenUsrStr, int AddEntropy);
rstate (pointer to state memory)
UsrStr (pointer to user character string)
LenUsrStr (length of the user character 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 entropy bytes
int
InitRandRMDSHA1_l (STATERMDSHA1 *rstate, char *UsrStr,
int LenUsrStr, int AddEntropy)
{
int MissingEntropy;
Generation of start value. In MissingEntropy is stored the number of requested
entropy bytes that were not available.
MissingEntropy = GetEntropy_l (NULL, rstate->XRMDSHA1, AddEntropy,
UsrStr, LenUsrStr);
First state transition, creation of start state.
ripemd160_l (rstate->XRMDSHA1, rstate->XRMDSHA1, 20);
Initialization of the step counter i .
rstate->RoundRMDSHA1 = 1;
Set the initialization flag.
 
Search WWH ::




Custom Search