1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-08 17:42:09 +03:00

- Fixed const correctness

- Added ctr_drbg_update for non-fixed data lengths
 - Fixed void pointer arithmetic
This commit is contained in:
Paul Bakker
2011-12-03 11:29:32 +00:00
parent cb37aa5912
commit 1bc9efc00a
2 changed files with 74 additions and 60 deletions

View File

@@ -96,7 +96,7 @@ ctr_drbg_context;
int ctr_drbg_init( ctr_drbg_context *ctx,
int (*f_entropy)(void *, unsigned char *, size_t),
void *p_entropy,
unsigned char *custom,
const unsigned char *custom,
size_t len );
/**
@@ -142,18 +142,17 @@ void ctr_drbg_set_reseed_interval( ctr_drbg_context *ctx,
* POLARSSL_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED
*/
int ctr_drbg_reseed( ctr_drbg_context *ctx,
unsigned char *additional, size_t len );
const unsigned char *additional, size_t len );
/**
* \brief CTR_DRBG update state
*
* \param ctx CTR_DRBG context
* \param data Data to update with
*
* \return 0 if successful
* \param additional Additional data to update state with
* \param add_len Length of additional data
*/
int ctr_drbg_update( ctr_drbg_context *ctx,
unsigned char data[CTR_DRBG_SEEDLEN] );
void ctr_drbg_update( ctr_drbg_context *ctx,
const unsigned char *additional, size_t add_len );
/**
* \brief CTR_DRBG generate random with additional update input
@@ -172,7 +171,7 @@ int ctr_drbg_update( ctr_drbg_context *ctx,
*/
int ctr_drbg_random_with_add( void *p_rng,
unsigned char *output, size_t output_len,
unsigned char *additional, size_t add_len );
const unsigned char *additional, size_t add_len );
/**
* \brief CTR_DRBG generate random