|
virtual UString | name () const override |
| Algorithm name (informational only). More...
|
|
virtual bool | read (void *, size_t) override |
| Get random data. More...
|
|
virtual bool | readByteBlock (ByteBlock &data, size_t size) |
| Get random data in a byte block. More...
|
|
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr> |
bool | readInt (INT &value) |
| Get a random integer value. More...
|
|
virtual bool | ready () const override |
| Check if the PRNG is ready. More...
|
|
virtual bool | seed (const void *, size_t) override |
| Seed (add entropy) to the PRNG. More...
|
|
Improved system-provided PRNG (pseudo-random numbers generator).
Use SystemRandomGenerator as base and add AES-based post-processing. Implemented as a thread-safe singleton.
An entropy state is stored in $HOME/.tsseed. The value of a state is initially loaded from this file. The first time the generator is used (no file), the state is loaded from the system PRNG.
A fixed AES-128 key K is used for the post-processing. The size of the state is 16 bytes, the AES block size.
Description of post-processing, added to the sytem PRNG:
Known limitations:
- The entropy file is rewritten after each block => poor performances.
- Concurrent processes overwrite the same .tsseed file.