Logo Search packages:      
Sourcecode: libtomcrypt version File versions  Download package

unsigned long rng_get_bytes ( unsigned char *  out,
unsigned long  outlen,
void(*)(void)  callback 
)

Read the system RNG

Parameters:
out Destination
outlen Length desired (octets)
callback Pointer to void function to act as "callback" when RNG is slow. This can be NULL
Returns:
Number of octets read

Definition at line 127 of file rng_get_bytes.c.

Referenced by rng_make_prng().

{
   unsigned long x;

   LTC_ARGCHK(out != NULL);

#if defined(LTC_DEVRANDOM)
   x = rng_nix(out, outlen, callback);   if (x != 0) { return x; }
#endif
#ifdef WIN32
   x = rng_win32(out, outlen, callback); if (x != 0) { return x; }
#endif
#ifdef ANSI_RNG
   x = rng_ansic(out, outlen, callback); if (x != 0) { return x; }
#endif
   return 0;
}


Generated by  Doxygen 1.6.0   Back to index