1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Adapt cipher and MD layer with _init() and _free()

This commit is contained in:
Paul Bakker
2014-07-01 14:53:22 +02:00
parent accaffe2c3
commit 84bbeb58df
13 changed files with 134 additions and 47 deletions

View File

@ -61,6 +61,8 @@ int ccm_init( ccm_context *ctx, cipher_id_t cipher,
memset( ctx, 0, sizeof( ccm_context ) );
cipher_init( &ctx->cipher_ctx );
cipher_info = cipher_info_from_values( cipher, keysize, POLARSSL_MODE_ECB );
if( cipher_info == NULL )
return( POLARSSL_ERR_CCM_BAD_INPUT );
@ -85,7 +87,7 @@ int ccm_init( ccm_context *ctx, cipher_id_t cipher,
*/
void ccm_free( ccm_context *ctx )
{
(void) cipher_free_ctx( &ctx->cipher_ctx );
cipher_free( &ctx->cipher_ctx );
polarssl_zeroize( ctx, sizeof( ccm_context ) );
}