Lines Matching refs:cipher_info
150 ctx->cipher_info->base->ctx_free_func( ctx->cipher_ctx ); in mbedtls_cipher_free()
155 int mbedtls_cipher_setup( mbedtls_cipher_context_t *ctx, const mbedtls_cipher_info_t *cipher_info ) in mbedtls_cipher_setup() argument
157 if( NULL == cipher_info || NULL == ctx ) in mbedtls_cipher_setup()
162 if( NULL == ( ctx->cipher_ctx = cipher_info->base->ctx_alloc_func() ) ) in mbedtls_cipher_setup()
165 ctx->cipher_info = cipher_info; in mbedtls_cipher_setup()
184 if( NULL == ctx || NULL == ctx->cipher_info ) in mbedtls_cipher_setkey()
187 if( ( ctx->cipher_info->flags & MBEDTLS_CIPHER_VARIABLE_KEY_LEN ) == 0 && in mbedtls_cipher_setkey()
188 (int) ctx->cipher_info->key_bitlen != key_bitlen ) in mbedtls_cipher_setkey()
200 MBEDTLS_MODE_CFB == ctx->cipher_info->mode || in mbedtls_cipher_setkey()
201 MBEDTLS_MODE_CTR == ctx->cipher_info->mode ) in mbedtls_cipher_setkey()
203 return ctx->cipher_info->base->setkey_enc_func( ctx->cipher_ctx, key, in mbedtls_cipher_setkey()
208 return ctx->cipher_info->base->setkey_dec_func( ctx->cipher_ctx, key, in mbedtls_cipher_setkey()
219 if( NULL == ctx || NULL == ctx->cipher_info || NULL == iv ) in mbedtls_cipher_set_iv()
226 if( ( ctx->cipher_info->flags & MBEDTLS_CIPHER_VARIABLE_IV_LEN ) != 0 ) in mbedtls_cipher_set_iv()
230 actual_iv_size = ctx->cipher_info->iv_size; in mbedtls_cipher_set_iv()
245 if( NULL == ctx || NULL == ctx->cipher_info ) in mbedtls_cipher_reset()
257 if( NULL == ctx || NULL == ctx->cipher_info ) in mbedtls_cipher_update_ad()
260 if( MBEDTLS_MODE_GCM == ctx->cipher_info->mode ) in mbedtls_cipher_update_ad()
276 if( NULL == ctx || NULL == ctx->cipher_info || NULL == olen ) in mbedtls_cipher_update()
284 if( ctx->cipher_info->mode == MBEDTLS_MODE_ECB ) in mbedtls_cipher_update()
291 if( 0 != ( ret = ctx->cipher_info->base->ecb_func( ctx->cipher_ctx, in mbedtls_cipher_update()
301 if( ctx->cipher_info->mode == MBEDTLS_MODE_GCM ) in mbedtls_cipher_update()
321 if( ctx->cipher_info->mode == MBEDTLS_MODE_CBC ) in mbedtls_cipher_update()
350 if( 0 != ( ret = ctx->cipher_info->base->cbc_func( ctx->cipher_ctx, in mbedtls_cipher_update()
391 if( 0 != ( ret = ctx->cipher_info->base->cbc_func( ctx->cipher_ctx, in mbedtls_cipher_update()
405 if( ctx->cipher_info->mode == MBEDTLS_MODE_CFB ) in mbedtls_cipher_update()
407 if( 0 != ( ret = ctx->cipher_info->base->cfb_func( ctx->cipher_ctx, in mbedtls_cipher_update()
421 if( ctx->cipher_info->mode == MBEDTLS_MODE_CTR ) in mbedtls_cipher_update()
423 if( 0 != ( ret = ctx->cipher_info->base->ctr_func( ctx->cipher_ctx, in mbedtls_cipher_update()
437 if( ctx->cipher_info->mode == MBEDTLS_MODE_STREAM ) in mbedtls_cipher_update()
439 if( 0 != ( ret = ctx->cipher_info->base->stream_func( ctx->cipher_ctx, in mbedtls_cipher_update()
629 if( NULL == ctx || NULL == ctx->cipher_info || NULL == olen ) in mbedtls_cipher_finish()
634 if( MBEDTLS_MODE_CFB == ctx->cipher_info->mode || in mbedtls_cipher_finish()
635 MBEDTLS_MODE_CTR == ctx->cipher_info->mode || in mbedtls_cipher_finish()
636 MBEDTLS_MODE_GCM == ctx->cipher_info->mode || in mbedtls_cipher_finish()
637 MBEDTLS_MODE_STREAM == ctx->cipher_info->mode ) in mbedtls_cipher_finish()
642 if( MBEDTLS_MODE_ECB == ctx->cipher_info->mode ) in mbedtls_cipher_finish()
651 if( MBEDTLS_MODE_CBC == ctx->cipher_info->mode ) in mbedtls_cipher_finish()
682 if( 0 != ( ret = ctx->cipher_info->base->cbc_func( ctx->cipher_ctx, in mbedtls_cipher_finish()
709 MBEDTLS_MODE_CBC != ctx->cipher_info->mode ) in mbedtls_cipher_set_padding_mode()
757 if( NULL == ctx || NULL == ctx->cipher_info || NULL == tag ) in mbedtls_cipher_write_tag()
763 if( MBEDTLS_MODE_GCM == ctx->cipher_info->mode ) in mbedtls_cipher_write_tag()
774 if( NULL == ctx || NULL == ctx->cipher_info || in mbedtls_cipher_check_tag()
780 if( MBEDTLS_MODE_GCM == ctx->cipher_info->mode ) in mbedtls_cipher_check_tag()
849 if( MBEDTLS_MODE_GCM == ctx->cipher_info->mode ) in mbedtls_cipher_auth_encrypt()
858 if( MBEDTLS_MODE_CCM == ctx->cipher_info->mode ) in mbedtls_cipher_auth_encrypt()
881 if( MBEDTLS_MODE_GCM == ctx->cipher_info->mode ) in mbedtls_cipher_auth_decrypt()
897 if( MBEDTLS_MODE_CCM == ctx->cipher_info->mode ) in mbedtls_cipher_auth_decrypt()