Functions | |
int | zrtp_entropy_add (zrtp_global_t *zrtp, const unsigned char *buffer, uint32_t length) |
Entropy accumulation routine. | |
int | zrtp_randstr (zrtp_global_t *zrtp, unsigned char *buffer, uint32_t length) |
Random string generation. |
MUST
be read by every developer using libzrtp. int zrtp_entropy_add | ( | zrtp_global_t * | zrtp, | |
const unsigned char * | buffer, | |||
uint32_t | length | |||
) |
Entropy accumulation routine.
The random number generation scheme is described in detail in chapter XXX. This function gets length
bytes of entropy from buffer
and hashes it into the special storage. This function should be called periodically from the user's space to increase entropy quality.
zrtp | - libzrtp global context; | |
buffer | - pointer to the buffer with entropy for accumulating; | |
length | - entropy size in bytes. |
int zrtp_randstr | ( | zrtp_global_t * | zrtp, | |
unsigned char * | buffer, | |||
uint32_t | length | |||
) |
Random string generation.
zrtp_randstr() generates length
bytes of "random" data. We say "random" because the "randomness" of the generated sequence depends on the quality of the entropy passed to zrtp_entropy_add(). If the user provides "good" entropy, zrtp_randstr() generates sufficiently "random" data.
zrtp | - libzrtp global context; | |
buffer | - buffer into which random data will be generated; | |
length | - length of required sequence in bytes. |