CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
Loading...
Searching...
No Matches
TrivialInsecureEntropySource Class Reference

A simple entropy source. More...

#include <entropy.h>

Public Types

using ValueType = uint64_t

Public Member Functions

 TrivialInsecureEntropySource ()
 Constructor, tries to generate an independent sequence of random numbers.
void reseed ()
 Reseed the PRNG.
ValueType operator() ()
 Get the next value from the PRNG.

Static Public Attributes

static constexpr bool IsSecure = false
 Definitely not secure!

Protected Member Functions

void reseed (uint16_t jumps)
 Reseed the PRNG with a provided set of jumps.

Detailed Description

A simple entropy source.

This wraps a few weak entropy sources to seed a PRNG. It is absolutely not secure and should not be used for anything that depends on cryptographically secure random numbers! Unfortunately, there is nothing on the Sonata instantiation of CHERIoT SAFE that can be used as a secure entropy source.

This is provided as a generic implementation that can be used with an interrupt source to provide a slightly better version for testing on FPGA and simulation environments that don't have anything secure.

Definition at line 47 of file entropy.h.

Member Typedef Documentation

◆ ValueType

using TrivialInsecureEntropySource::ValueType = uint64_t

Definition at line 73 of file entropy.h.

Constructor & Destructor Documentation

◆ TrivialInsecureEntropySource()

TrivialInsecureEntropySource::TrivialInsecureEntropySource ( )
inline

Constructor, tries to generate an independent sequence of random numbers.

Definition at line 79 of file entropy.h.

References reseed().

Member Function Documentation

◆ operator()()

ValueType TrivialInsecureEntropySource::operator() ( )
inline

Get the next value from the PRNG.

Definition at line 91 of file entropy.h.

◆ reseed() [1/2]

void TrivialInsecureEntropySource::reseed ( )
inline

Reseed the PRNG.

Definition at line 85 of file entropy.h.

References reseed().

Referenced by reseed(), and TrivialInsecureEntropySource().

◆ reseed() [2/2]

void TrivialInsecureEntropySource::reseed ( uint16_t jumps)
inlineprotected

Reseed the PRNG with a provided set of jumps.

Definition at line 53 of file entropy.h.

Member Data Documentation

◆ IsSecure

bool TrivialInsecureEntropySource::IsSecure = false
staticconstexpr

Definitely not secure!

Definition at line 76 of file entropy.h.


The documentation for this class was generated from the following file: