mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-24 00:06:32 +01:00
Rename md_init_ctx() to md_setup()
This commit is contained in:
parent
d4b9173269
commit
abb674467b
16 changed files with 32 additions and 32 deletions
|
|
@ -29,7 +29,7 @@ void md_process( )
|
|||
{
|
||||
info = md_info_from_type( *md_type_ptr );
|
||||
TEST_ASSERT( info != NULL );
|
||||
TEST_ASSERT( md_init_ctx( &ctx, info, 0 ) == 0 );
|
||||
TEST_ASSERT( md_setup( &ctx, info, 0 ) == 0 );
|
||||
TEST_ASSERT( md_process( &ctx, buf ) == 0 );
|
||||
md_free( &ctx );
|
||||
}
|
||||
|
|
@ -54,8 +54,8 @@ void md_null_args( )
|
|||
|
||||
TEST_ASSERT( md_info_from_string( NULL ) == NULL );
|
||||
|
||||
TEST_ASSERT( md_init_ctx( &ctx, NULL, 0 ) == POLARSSL_ERR_MD_BAD_INPUT_DATA );
|
||||
TEST_ASSERT( md_init_ctx( NULL, info, 0 ) == POLARSSL_ERR_MD_BAD_INPUT_DATA );
|
||||
TEST_ASSERT( md_setup( &ctx, NULL, 0 ) == POLARSSL_ERR_MD_BAD_INPUT_DATA );
|
||||
TEST_ASSERT( md_setup( NULL, info, 0 ) == POLARSSL_ERR_MD_BAD_INPUT_DATA );
|
||||
|
||||
TEST_ASSERT( md_starts( NULL ) == POLARSSL_ERR_MD_BAD_INPUT_DATA );
|
||||
TEST_ASSERT( md_starts( &ctx ) == POLARSSL_ERR_MD_BAD_INPUT_DATA );
|
||||
|
|
@ -195,7 +195,7 @@ void md_text_multi( char *text_md_name, char *text_src_string,
|
|||
strncpy( (char *) md_name, text_md_name, sizeof(md_name) - 1 );
|
||||
md_info = md_info_from_string(md_name);
|
||||
TEST_ASSERT( md_info != NULL );
|
||||
TEST_ASSERT ( 0 == md_init_ctx( &ctx, md_info, 0 ) );
|
||||
TEST_ASSERT ( 0 == md_setup( &ctx, md_info, 0 ) );
|
||||
|
||||
TEST_ASSERT ( 0 == md_starts( &ctx ) );
|
||||
TEST_ASSERT ( ctx.md_ctx != NULL );
|
||||
|
|
@ -233,7 +233,7 @@ void md_hex_multi( char *text_md_name, char *hex_src_string,
|
|||
strncpy( (char *) md_name, text_md_name, sizeof(md_name) - 1 );
|
||||
md_info = md_info_from_string(md_name);
|
||||
TEST_ASSERT( md_info != NULL );
|
||||
TEST_ASSERT ( 0 == md_init_ctx( &ctx, md_info, 0 ) );
|
||||
TEST_ASSERT ( 0 == md_setup( &ctx, md_info, 0 ) );
|
||||
|
||||
src_len = unhexify( src_str, hex_src_string );
|
||||
|
||||
|
|
@ -307,7 +307,7 @@ void md_hmac_multi( char *text_md_name, int trunc_size, char *hex_key_string,
|
|||
strncpy( (char *) md_name, text_md_name, sizeof(md_name) - 1 );
|
||||
md_info = md_info_from_string( md_name );
|
||||
TEST_ASSERT( md_info != NULL );
|
||||
TEST_ASSERT ( 0 == md_init_ctx( &ctx, md_info, 1 ) );
|
||||
TEST_ASSERT ( 0 == md_setup( &ctx, md_info, 1 ) );
|
||||
|
||||
key_len = unhexify( key_str, hex_key_string );
|
||||
src_len = unhexify( src_str, hex_src_string );
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ void pbkdf2_hmac( int hash, char *hex_password_string,
|
|||
TEST_ASSERT( info != NULL );
|
||||
if( info == NULL )
|
||||
return;
|
||||
TEST_ASSERT( md_init_ctx( &ctx, info, 1 ) == 0 );
|
||||
TEST_ASSERT( md_setup( &ctx, info, 1 ) == 0 );
|
||||
TEST_ASSERT( pkcs5_pbkdf2_hmac( &ctx, pw_str, pw_len, salt_str, salt_len,
|
||||
it_cnt, key_len, key ) == 0 );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue