Module prng

Source
Expand description

Module containing methods for accessing or configuring the libcoap PRNG.

This module provides basic functions to seed the libcoap PRNG and retrieve random bytes from it.

Additionally, if the rand feature is enabled, this module contains integrations with the rand crate that allow using the libcoap PRNG as a rand::Rng or setting the libcoap PRNG to an existing rand::Rng.

Structs§

CoapRng
Implementation of the rand::RngCore trait based on libcoap’s PRNG.

Functions§

coap_prng_try_fill
Attempts to fill dest with random bytes using libcoap’s PRNG.
seed_coap_prng
Seeds the default PRNG of libcoap with the provided seed.
set_coap_prng
Configures libcoap to use the provided rng for pseudo-random number generation instead of its default PRNG.