mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-01 10:06:53 +03:00
Merge branch 'development' into Remove__CHECK_PARAMS_option
This commit is contained in:
@ -36,8 +36,11 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char *buf;
|
||||
unsigned char *buf; /* Pointer to a buffer of length bytes. */
|
||||
size_t length;
|
||||
/* If fallback_f_rng is NULL, fail after delivering length bytes. */
|
||||
int ( *fallback_f_rng )( void*, unsigned char *, size_t );
|
||||
void *fallback_p_rng;
|
||||
} mbedtls_test_rnd_buf_info;
|
||||
|
||||
/**
|
||||
@ -67,24 +70,25 @@ int mbedtls_test_rnd_std_rand( void *rng_state,
|
||||
size_t len );
|
||||
|
||||
/**
|
||||
* This function only returns zeros
|
||||
* This function only returns zeros.
|
||||
*
|
||||
* rng_state shall be NULL.
|
||||
* \p rng_state shall be \c NULL.
|
||||
*/
|
||||
int mbedtls_test_rnd_zero_rand( void *rng_state,
|
||||
unsigned char *output,
|
||||
size_t len );
|
||||
|
||||
/**
|
||||
* This function returns random based on a buffer it receives.
|
||||
* This function returns random data based on a buffer it receives.
|
||||
*
|
||||
* rng_state shall be a pointer to a rnd_buf_info structure.
|
||||
* \p rng_state shall be a pointer to a #mbedtls_test_rnd_buf_info structure.
|
||||
*
|
||||
* The number of bytes released from the buffer on each call to
|
||||
* the random function is specified by per_call. (Can be between
|
||||
* 1 and 4)
|
||||
* the random function is specified by \p len.
|
||||
*
|
||||
* After the buffer is empty it will return rand();
|
||||
* After the buffer is empty, this function will call the fallback RNG in the
|
||||
* #mbedtls_test_rnd_buf_info structure if there is one, and
|
||||
* will return #MBEDTLS_ERR_ENTROPY_SOURCE_FAILED otherwise.
|
||||
*/
|
||||
int mbedtls_test_rnd_buffer_rand( void *rng_state,
|
||||
unsigned char *output,
|
||||
@ -96,7 +100,7 @@ int mbedtls_test_rnd_buffer_rand( void *rng_state,
|
||||
* Pseudo random is based on the XTEA encryption algorithm to
|
||||
* generate pseudorandom.
|
||||
*
|
||||
* rng_state shall be a pointer to a rnd_pseudo_info structure.
|
||||
* \p rng_state shall be a pointer to a #mbedtls_test_rnd_pseudo_info structure.
|
||||
*/
|
||||
int mbedtls_test_rnd_pseudo_rand( void *rng_state,
|
||||
unsigned char *output,
|
||||
|
Reference in New Issue
Block a user