GATE
Loading...
Searching...
No Matches
randomgen.h File Reference

Random number generation. More...

#include "gate/gate_core_api.h"
#include "gate/gatetypes.h"

Functions

GATE_CORE_API gate_result_t gate_randomgenerator_create (gate_randomsession_t *session)
 Creates a random number generator instance and initializes a session object to access it.
 
GATE_CORE_API gate_result_t gate_randomgenerator_get_num (gate_randomsession_t *session, gate_uint64_t *number)
 Generates a random 64-bit number.
 
GATE_CORE_API gate_result_t gate_randomgenerator_get_buffer (gate_randomsession_t *session, void *buffer, gate_size_t bufferlen)
 Fills a byte buffer with random data.
 
GATE_CORE_API gate_result_t gate_randomgenerator_destroy (gate_randomsession_t *session)
 Destroys the random number generator sessions and releases its resources.
 

Detailed Description

Random number generation.

Function Documentation

◆ gate_randomgenerator_create()

GATE_CORE_API gate_result_t gate_randomgenerator_create ( gate_randomsession_t * session)

Creates a random number generator instance and initializes a session object to access it.

Parameters
[out]sessionpointer to session handle to be filled
Returns
GATE_RESULT_* result codes

◆ gate_randomgenerator_get_num()

GATE_CORE_API gate_result_t gate_randomgenerator_get_num ( gate_randomsession_t * session,
gate_uint64_t * number )

Generates a random 64-bit number.

Parameters
[in]sessionpointer to session handle
[out]numberpointer to UI64 number to be filled with random bits
Returns
GATE_RESULT_* result codes

◆ gate_randomgenerator_get_buffer()

GATE_CORE_API gate_result_t gate_randomgenerator_get_buffer ( gate_randomsession_t * session,
void * buffer,
gate_size_t bufferlen )

Fills a byte buffer with random data.

Parameters
[in]sessionpointer to session handle
[out]bufferpointer to buffer to be filled with random data
[in]bufferlenlength of buffer in bytes
Returns
GATE_RESULT_* result codes

◆ gate_randomgenerator_destroy()

GATE_CORE_API gate_result_t gate_randomgenerator_destroy ( gate_randomsession_t * session)

Destroys the random number generator sessions and releases its resources.

Parameters
[in]sessionpointer to session handle to be destroyed
Returns
GATE_RESULT_* result codes