mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-02-18 16:33:01 +00:00
Split mbedtls_ctr_drbg_init() -> seed()
This commit is contained in:
@@ -516,13 +516,15 @@ int main( int argc, char *argv[] )
|
||||
{
|
||||
mbedtls_ctr_drbg_context ctr_drbg;
|
||||
|
||||
if( mbedtls_ctr_drbg_init( &ctr_drbg, myrand, NULL, NULL, 0 ) != 0 )
|
||||
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)",
|
||||
if( mbedtls_ctr_drbg_random( &ctr_drbg, buf, BUFSIZE ) != 0 )
|
||||
mbedtls_exit(1) );
|
||||
|
||||
if( mbedtls_ctr_drbg_init( &ctr_drbg, myrand, NULL, NULL, 0 ) != 0 )
|
||||
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 );
|
||||
TIME_AND_TSC( "CTR_DRBG (PR)",
|
||||
|
||||
Reference in New Issue
Block a user