CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
random_number_generator.c File Reference
#include "crypto/random_number_generator.h"
#include <string.h>
Include dependency graph for random_number_generator.c:

Functions

static uint32_t xorshift32 (void)
uint32_t CRYPTO_generate_random_uint32 (uint32_t more_random_data)
 Generate a pseudo-random number. Not intended for cryptographic use.
void CRYPTO_random_fill_buffer (uint32_t more_random_data, uint8_t buffer[], uint32_t size)
 Fill a buffer with pseudo-random data.

Variables

static uint32_t rng_state = 0x12345678

Function Documentation

◆ CRYPTO_generate_random_uint32()

uint32_t CRYPTO_generate_random_uint32 ( uint32_t more_random_data)

Generate a pseudo-random number. Not intended for cryptographic use.

Parameters
more_random_dataA seed input value, like HAL_GetTick().
Returns
A pseudo-random number.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CRYPTO_random_fill_buffer()

void CRYPTO_random_fill_buffer ( uint32_t more_random_data,
uint8_t buffer[],
uint32_t size )

Fill a buffer with pseudo-random data.

Parameters
more_random_dataA seed input value, like HAL_GetTick().
bufferDestination buffer.
sizeSize of the buffer in bytes.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xorshift32()

uint32_t xorshift32 ( void )
inlinestatic
Here is the caller graph for this function:

Variable Documentation

◆ rng_state

uint32_t rng_state = 0x12345678
static