Merge pull request #2894 from gilles-peskine-arm/drbg-set_entropy_len-2.16
Backport 2.16: Allow xxx_drbg_set_entropy_len before xxx_drbg_seed
This commit is contained in:
commit
c0546439c4
7 changed files with 108 additions and 105 deletions
|
@ -674,12 +674,13 @@ int main( int argc, char *argv[] )
|
|||
mbedtls_ctr_drbg_context ctr_drbg;
|
||||
|
||||
mbedtls_ctr_drbg_init( &ctr_drbg );
|
||||
|
||||
if( mbedtls_ctr_drbg_seed( &ctr_drbg, myrand, NULL, NULL, 0 ) != 0 )
|
||||
mbedtls_exit(1);
|
||||
TIME_AND_TSC( "CTR_DRBG (NOPR)",
|
||||
mbedtls_ctr_drbg_random( &ctr_drbg, buf, BUFSIZE ) );
|
||||
mbedtls_ctr_drbg_free( &ctr_drbg );
|
||||
|
||||
mbedtls_ctr_drbg_init( &ctr_drbg );
|
||||
if( mbedtls_ctr_drbg_seed( &ctr_drbg, myrand, NULL, NULL, 0 ) != 0 )
|
||||
mbedtls_exit(1);
|
||||
mbedtls_ctr_drbg_set_prediction_resistance( &ctr_drbg, MBEDTLS_CTR_DRBG_PR_ON );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue