[][src]Module nanorand::entropy

Sources for obtaining entropy.

Re-exports

pub use windows::entropy_from_system;

Modules

windows

An entropy generator for Windows, using WinAPI's BCryptGenRandom function.

Functions

backup_entropy

A backup entropy source, trying rdseed first, and if it fails or does not complete, combining it with or using system time-based entropy generation.

emergency_system_time_entropy

An emergency system time-based entropy source.
Should be slightly better than just piping the system time into a seed, but for the love of god, don't use this unless you have a REALLY good reason.

rdseed_entropy

An rdseed-based entropy source.
Only works on x86/x86_64 platforms where the rdseed instructions are available.
Returns None if rdseed is not available.
Returns Ok if it sucesfully managed to pull the requested amount of bytes.
Returns Err if it couldn't pull the requested amount of bytes.
VERY unreliable.