Esempio n. 1
0
/* Initialize this random subsystem.  If FULL is false, this function
   merely calls the basic initialization of the module and does not do
   anything more.  Doing this is not really required but when running
   in a threaded environment we might get a race condition
   otherwise. */
void
_gcry_random_initialize (int full)
{
  static int nonce_initialized;
  int err;

  if (!nonce_initialized)
    {
      nonce_initialized = 1;
      err = ath_mutex_init (&nonce_buffer_lock);
      if (err)
        log_fatal ("failed to create the nonce buffer lock: %s\n",
                   strerror (err) );
    }

  if (fips_mode ())
    _gcry_rngfips_initialize (full);
  else if (rng_types.standard)
    _gcry_rngcsprng_initialize (full);
  else if (rng_types.fips)
    _gcry_rngfips_initialize (full);
  else if (rng_types.system)
    _gcry_rngsystem_initialize (full);
  else
    _gcry_rngcsprng_initialize (full);
}
Esempio n. 2
0
/* Initialize this random subsystem.  If FULL is false, this function
   merely calls the basic initialization of the module and does not do
   anything more.  Doing this is not really required but when running
   in a threaded environment we might get a race condition
   otherwise. */
void
_gcry_random_initialize (int full)
{
  if (fips_mode ())
    _gcry_rngfips_initialize (full);
  else if (rng_types.standard)
    _gcry_rngcsprng_initialize (full);
  else if (rng_types.fips)
    _gcry_rngfips_initialize (full);
  else if (rng_types.system)
    _gcry_rngsystem_initialize (full);
  else
    _gcry_rngcsprng_initialize (full);
}
Esempio n. 3
0
/* Initialize this random subsystem.  If FULL is false, this function
   merely calls the basic initialization of the module and does not do
   anything more.  Doing this is not really required but when running
   in a threaded environment we might get a race condition
   otherwise. */
void
_gcry_random_initialize (int full)
{
  if (fips_mode ())
    _gcry_rngfips_initialize (full);
  else
    _gcry_rngcsprng_initialize (full);
}