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:
@ -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 ) );
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user