Loading...
Searching...
No Matches
lime::RNG Class Referenceabstract

Random number generator interface. More...

`#include <lime_crypto_primitives.hpp>`

Inheritance diagram for lime::RNG:

## Public Member Functions

virtual void | randomize (sBuffer< lime::settings::DRrandomSeedSize > &buffer)=0
| fill the given RandomSeed buffer with Random bytes
virtual uint32_t | randomize ()=0
| Generate a 32 bits unsigned integer(used to generate keys Id) The MSbit is forced to 0 to avoid dealing with DB misinterpreting unsigned values into signed one Our random number is actually on 31 bits.
virtual void | randomize (uint8_t *buffer, const size_t size)=0
virtual | ~RNG ()=default

## Detailed Description

Random number generator interface.

This abstract class is used to hold a RNG object It provides explicit functions to generate:

- random key for Double Ratchet
- random keys Id on 31 bits. It also expose a generic function to generate random in a buffer

## Constructor & Destructor Documentation

## ~RNG()

virtual lime::RNG::~RNG | ( |  | ) |

virtual default

## Member Function Documentation

## randomize() [1/3]

virtual uint32_t lime::RNG::randomize | ( |  | ) |

pure virtual

Generate a 32 bits unsigned integer(used to generate keys Id) The MSbit is forced to 0 to avoid dealing with DB misinterpreting unsigned values into signed one Our random number is actually on 31 bits.

Returns
  a random 32 bits unsigned integer

Implemented in lime::bctbx_RNG.

## randomize() [2/3]

virtual void lime::RNG::randomize | ( | sBuffer< lime::settings::DRrandomSeedSize > & | buffer | ) |

pure virtual

fill the given RandomSeed buffer with Random bytes

Parameters

  [in,out] | buffer | point to the beginning of the buffer to be filled with random bytes

Implemented in lime::bctbx_RNG.

## randomize() [3/3]

virtual void lime::RNG::randomize | ( | uint8_t * | buffer,
|  | const size_t | size )

pure virtual

fill a buffer with random numbers

Parameters

  [in,out] | buffer | The buffer to be filled with random (callers responsability to allocate memory)
  [in] | size | size in bytes of the random generated, buffer must be at least of this size

Implemented in lime::bctbx_RNG.

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

- /build/lime-9DdzML/lime-5.3.105+dfsg/src/lime_crypto_primitives.hpp