Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Random Function APIs

Random Function APIs . More...

Functions

void sys_rand_get (void *dst, size_t len)
 Fill the destination buffer with random data values that should pass general randomness tests.
 
int sys_csrand_get (void *dst, size_t len)
 Fill the destination buffer with cryptographically secure random data values.
 
static uint8_t sys_rand8_get (void)
 Return a 8-bit random value that should pass general randomness tests.
 
static uint16_t sys_rand16_get (void)
 Return a 16-bit random value that should pass general randomness tests.
 
static uint32_t sys_rand32_get (void)
 Return a 32-bit random value that should pass general randomness tests.
 
static uint64_t sys_rand64_get (void)
 Return a 64-bit random value that should pass general randomness tests.
 

Detailed Description

Random Function APIs .

Since
1.0
Version
1.0.0

Function Documentation

◆ sys_csrand_get()

int sys_csrand_get ( void * dst,
size_t len )

#include <zephyr/random/random.h>

Fill the destination buffer with cryptographically secure random data values.

Note
If the random values requested do not need to be cryptographically secure then use sys_rand_get() instead.
Parameters
[out]dstdestination buffer to fill.
lensize of the destination buffer.
Returns
0 if success, -EIO if entropy reseed error

◆ sys_rand16_get()

static uint16_t sys_rand16_get ( void )
inlinestatic

#include <zephyr/random/random.h>

Return a 16-bit random value that should pass general randomness tests.

Note
The random value returned is not a cryptographically secure random number value.
Returns
16-bit random value.

◆ sys_rand32_get()

static uint32_t sys_rand32_get ( void )
inlinestatic

#include <zephyr/random/random.h>

Return a 32-bit random value that should pass general randomness tests.

Note
The random value returned is not a cryptographically secure random number value.
Returns
32-bit random value.

◆ sys_rand64_get()

static uint64_t sys_rand64_get ( void )
inlinestatic

#include <zephyr/random/random.h>

Return a 64-bit random value that should pass general randomness tests.

Note
The random value returned is not a cryptographically secure random number value.
Returns
64-bit random value.

◆ sys_rand8_get()

static uint8_t sys_rand8_get ( void )
inlinestatic

#include <zephyr/random/random.h>

Return a 8-bit random value that should pass general randomness tests.

Note
The random value returned is not a cryptographically secure random number value.
Returns
8-bit random value.

◆ sys_rand_get()

void sys_rand_get ( void * dst,
size_t len )

#include <zephyr/random/random.h>

Fill the destination buffer with random data values that should pass general randomness tests.

Note
The random values returned are not considered cryptographically secure random number values.
Parameters
[out]dstdestination buffer to fill with random data.
lensize of the destination buffer.