![]() |
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
#include "ws_symbol_export.h"
Go to the source code of this file.
Classes | |
struct | _sober128_prng |
Typedefs | |
typedef struct _sober128_prng | sober128_prng |
Functions | |
WS_DLL_PUBLIC int | sober128_start (sober128_prng *prng) |
Initialize a Sober128 PRNG instance. | |
WS_DLL_PUBLIC int | sober128_add_entropy (const unsigned char *buf, unsigned long len, sober128_prng *prng) |
Inject entropy into a Sober128 PRNG instance. | |
WS_DLL_PUBLIC unsigned long | sober128_read (unsigned char *buf, unsigned long len, sober128_prng *prng) |
Generate random bytes from a Sober128 PRNG instance. | |
This file is derived from sober128 implementation in corosync cluster engine. corosync cluster engine borrows the implementation from LibTomCrypt.
The latest version of the original code can be found at http://www.libtom.net/LibTomCrypt/ according to which this code is in the Public Domain
WS_DLL_PUBLIC int sober128_add_entropy | ( | const unsigned char * | buf, |
unsigned long | len, | ||
sober128_prng * | prng | ||
) |
Inject entropy into a Sober128 PRNG instance.
Adds external entropy to the PRNG state, improving randomness quality.
buf | Pointer to entropy bytes. |
len | Number of bytes in buf . |
prng | Pointer to an initialized sober128_prng structure. |
0
on success, or a non-zero value on failure. WS_DLL_PUBLIC unsigned long sober128_read | ( | unsigned char * | buf, |
unsigned long | len, | ||
sober128_prng * | prng | ||
) |
Generate random bytes from a Sober128 PRNG instance.
Fills the output buffer with pseudo-random bytes from the PRNG. The PRNG must be initialized and seeded with entropy before use.
buf | Pointer to buffer to receive random bytes. |
len | Number of bytes to generate. |
prng | Pointer to a seeded sober128_prng structure. |
buf
. WS_DLL_PUBLIC int sober128_start | ( | sober128_prng * | prng | ) |
Initialize a Sober128 PRNG instance.
prng | Pointer to a sober128_prng structure to initialize. |
0
on success, or a non-zero value on failure.