Cryptography Reference
In-Depth Information
set an initial value for
rand64_l()
Function:
clint * seed64_l (CLINT seed_l);
Syntax:
seed_l
(initial value)
Input:
pointer to
BUFF64
with previous value of
SEED64
Return:
The next function returns random numbers of type
ULONG
. All numbers are
generated with a call to
rand64_l()
, where the most-significant digits of
SEED64
are used to build a number of the requested type.
Function:
generation of a random number of type
unsigned long
Syntax:
unsigned long ulrand64_l (void);
random number of type
unsigned long
Return:
ULONG
ulrand64_l (void)
{
ULONG val;
USHORT l;
rand64_l();
l = DIGITS_L (SEED64);
switch (l)
{
case 4:
case 3:
case 2:
val = (ULONG)SEED64[l-1];
val += ((ULONG)SEED64[l] << BITPERDGT);
break;
case 1:
val = (ULONG)SEED64[l];
break;
default:
val=0;
}
return val;
}