1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

Split cipher_set_iv() out of cipher_reset()

This commit is contained in:
Manuel Pégourié-Gonnard
2013-09-03 13:04:44 +02:00
parent 9241be7ac5
commit 9c853b910c
6 changed files with 79 additions and 26 deletions

View File

@ -306,7 +306,12 @@ int main( int argc, char *argv[] )
fprintf( stderr, "cipher_setkey() returned error\n");
goto exit;
}
if( cipher_reset( &cipher_ctx, IV, 16, NULL, 0 ) != 0 )
if( cipher_set_iv( &cipher_ctx, IV, 16 ) != 0 )
{
fprintf( stderr, "cipher_set_iv() returned error\n");
goto exit;
}
if( cipher_reset( &cipher_ctx, NULL, 0 ) != 0 )
{
fprintf( stderr, "cipher_reset() returned error\n");
goto exit;
@ -424,7 +429,8 @@ int main( int argc, char *argv[] )
cipher_setkey( &cipher_ctx, digest, cipher_info->key_length,
POLARSSL_DECRYPT );
cipher_reset( &cipher_ctx, IV, 16, NULL, 0 );
cipher_set_iv( &cipher_ctx, IV, 16 );
cipher_reset( &cipher_ctx, NULL, 0 );
md_hmac_starts( &md_ctx, digest, 32 );