Lines Matching refs:cipher_info
240 mbedtls_cipher_get_base(ctx->cipher_info)->ctx_free_func(ctx->cipher_ctx); in mbedtls_cipher_free()
249 if (dst == NULL || dst->cipher_info == NULL || in mbedtls_cipher_clone()
250 src == NULL || src->cipher_info == NULL) { in mbedtls_cipher_clone()
254 dst->cipher_info = src->cipher_info; in mbedtls_cipher_clone()
265 if (mbedtls_cipher_get_base(dst->cipher_info)->ctx_clone_func) in mbedtls_cipher_clone()
266 mbedtls_cipher_get_base(dst->cipher_info)->ctx_clone_func(dst->cipher_ctx, src->cipher_ctx); in mbedtls_cipher_clone()
276 const mbedtls_cipher_info_t *cipher_info) in mbedtls_cipher_setup() argument
278 if (cipher_info == NULL) { in mbedtls_cipher_setup()
284 if (mbedtls_cipher_get_base(cipher_info)->ctx_alloc_func != NULL) { in mbedtls_cipher_setup()
285 ctx->cipher_ctx = mbedtls_cipher_get_base(cipher_info)->ctx_alloc_func(); in mbedtls_cipher_setup()
291 ctx->cipher_info = cipher_info; in mbedtls_cipher_setup()
298 const mbedtls_cipher_info_t *cipher_info, in mbedtls_cipher_setup_psa() argument
304 if (NULL == cipher_info || NULL == ctx) { in mbedtls_cipher_setup_psa()
310 alg = mbedtls_psa_translate_cipher_mode(((mbedtls_cipher_mode_t) cipher_info->mode), taglen); in mbedtls_cipher_setup_psa()
314 if (mbedtls_psa_translate_cipher_type(((mbedtls_cipher_type_t) cipher_info->type)) == 0) { in mbedtls_cipher_setup_psa()
326 ctx->cipher_info = cipher_info; in mbedtls_cipher_setup_psa()
333 const mbedtls_cipher_info_t *cipher_info ) in mbedtls_cipher_setup_info() argument
335 if (NULL == cipher_info || NULL == ctx) in mbedtls_cipher_setup_info()
338 ctx->cipher_info = cipher_info; in mbedtls_cipher_setup_info()
350 if (ctx->cipher_info == NULL) { in mbedtls_cipher_setkey()
354 if (MBEDTLS_MODE_ECB == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) && in mbedtls_cipher_setkey()
382 ((mbedtls_cipher_type_t) ctx->cipher_info->type)); in mbedtls_cipher_setkey()
418 if ((ctx->cipher_info->flags & MBEDTLS_CIPHER_VARIABLE_KEY_LEN) == 0 && in mbedtls_cipher_setkey()
419 (int) mbedtls_cipher_info_get_key_bitlen(ctx->cipher_info) != key_bitlen) { in mbedtls_cipher_setkey()
431 MBEDTLS_MODE_CFB == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) || in mbedtls_cipher_setkey()
432 MBEDTLS_MODE_OFB == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) || in mbedtls_cipher_setkey()
433 MBEDTLS_MODE_CTR == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_setkey()
434 return mbedtls_cipher_get_base(ctx->cipher_info)->setkey_enc_func(ctx->cipher_ctx, key, in mbedtls_cipher_setkey()
439 return mbedtls_cipher_get_base(ctx->cipher_info)->setkey_dec_func(ctx->cipher_ctx, key, in mbedtls_cipher_setkey()
444 return mbedtls_cipher_get_base(ctx->cipher_info)->setkey_enc_func(ctx->cipher_ctx, key, in mbedtls_cipher_setkey()
458 if (ctx->cipher_info == NULL) { in mbedtls_cipher_set_iv()
475 if ((ctx->cipher_info->flags & MBEDTLS_CIPHER_VARIABLE_IV_LEN) != 0) { in mbedtls_cipher_set_iv()
478 actual_iv_size = mbedtls_cipher_info_get_iv_size(ctx->cipher_info); in mbedtls_cipher_set_iv()
487 if (((mbedtls_cipher_type_t) ctx->cipher_info->type) == MBEDTLS_CIPHER_CHACHA20) { in mbedtls_cipher_set_iv()
502 if (((mbedtls_cipher_type_t) ctx->cipher_info->type) == MBEDTLS_CIPHER_CHACHA20_POLY1305 && in mbedtls_cipher_set_iv()
510 if (MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_set_iv()
518 if (MBEDTLS_MODE_CCM_STAR_NO_TAG == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_set_iv()
553 if (ctx->cipher_info == NULL) { in mbedtls_cipher_reset()
574 if (ctx->cipher_info == NULL) { in mbedtls_cipher_update_ad()
588 if (MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_update_ad()
595 if (MBEDTLS_CIPHER_CHACHA20_POLY1305 == ((mbedtls_cipher_type_t) ctx->cipher_info->type)) { in mbedtls_cipher_update_ad()
625 if (ctx->cipher_info == NULL) { in mbedtls_cipher_update()
644 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_ECB) { in mbedtls_cipher_update()
651 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->ecb_func(ctx->cipher_ctx, in mbedtls_cipher_update()
661 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_GCM) { in mbedtls_cipher_update()
669 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_CCM_STAR_NO_TAG) { in mbedtls_cipher_update()
677 if (((mbedtls_cipher_type_t) ctx->cipher_info->type) == MBEDTLS_CIPHER_CHACHA20_POLY1305) { in mbedtls_cipher_update()
690 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_CBC) { in mbedtls_cipher_update()
718 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->cbc_func(ctx->cipher_ctx, in mbedtls_cipher_update()
761 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->cbc_func(ctx->cipher_ctx, in mbedtls_cipher_update()
777 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_CFB) { in mbedtls_cipher_update()
778 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->cfb_func(ctx->cipher_ctx, in mbedtls_cipher_update()
793 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_OFB) { in mbedtls_cipher_update()
794 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->ofb_func(ctx->cipher_ctx, in mbedtls_cipher_update()
809 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_CTR) { in mbedtls_cipher_update()
810 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->ctr_func(ctx->cipher_ctx, in mbedtls_cipher_update()
826 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_XTS) { in mbedtls_cipher_update()
832 ret = mbedtls_cipher_get_base(ctx->cipher_info)->xts_func(ctx->cipher_ctx, in mbedtls_cipher_update()
849 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_STREAM) { in mbedtls_cipher_update()
850 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->stream_func(ctx->cipher_ctx, in mbedtls_cipher_update()
1062 if (ctx->cipher_info == NULL) { in mbedtls_cipher_finish()
1080 if (MBEDTLS_MODE_CBC == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_finish()
1087 if (MBEDTLS_MODE_CFB == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) || in mbedtls_cipher_finish()
1088 MBEDTLS_MODE_OFB == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) || in mbedtls_cipher_finish()
1089 MBEDTLS_MODE_CTR == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) || in mbedtls_cipher_finish()
1090 MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) || in mbedtls_cipher_finish()
1091 MBEDTLS_MODE_CCM_STAR_NO_TAG == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) || in mbedtls_cipher_finish()
1092 MBEDTLS_MODE_XTS == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) || in mbedtls_cipher_finish()
1093 MBEDTLS_MODE_STREAM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_finish()
1097 if ((MBEDTLS_CIPHER_CHACHA20 == ((mbedtls_cipher_type_t) ctx->cipher_info->type)) || in mbedtls_cipher_finish()
1098 (MBEDTLS_CIPHER_CHACHA20_POLY1305 == ((mbedtls_cipher_type_t) ctx->cipher_info->type))) { in mbedtls_cipher_finish()
1102 if (MBEDTLS_MODE_ECB == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_finish()
1111 if (MBEDTLS_MODE_CBC == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_finish()
1139 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->cbc_func(ctx->cipher_ctx, in mbedtls_cipher_finish()
1170 if (NULL == ctx->cipher_info || in mbedtls_cipher_set_padding_mode()
1171 MBEDTLS_MODE_CBC != ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_set_padding_mode()
1230 if (ctx->cipher_info == NULL) { in mbedtls_cipher_write_tag()
1248 if (MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_write_tag()
1259 if (MBEDTLS_CIPHER_CHACHA20_POLY1305 == ((mbedtls_cipher_type_t) ctx->cipher_info->type)) { in mbedtls_cipher_write_tag()
1279 if (ctx->cipher_info == NULL) { in mbedtls_cipher_check_tag()
1300 if (MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_check_tag()
1325 if (MBEDTLS_CIPHER_CHACHA20_POLY1305 == ((mbedtls_cipher_type_t) ctx->cipher_info->type)) { in mbedtls_cipher_check_tag()
1396 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) != MBEDTLS_MODE_ECB) { in mbedtls_cipher_crypt()
1491 if (MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_aead_encrypt()
1499 if (MBEDTLS_MODE_CCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_aead_encrypt()
1507 if (MBEDTLS_CIPHER_CHACHA20_POLY1305 == ((mbedtls_cipher_type_t) ctx->cipher_info->type)) { in mbedtls_cipher_aead_encrypt()
1509 if ((iv_len != mbedtls_cipher_info_get_iv_size(ctx->cipher_info)) || in mbedtls_cipher_aead_encrypt()
1569 if (MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_aead_decrypt()
1585 if (MBEDTLS_MODE_CCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_aead_decrypt()
1601 if (MBEDTLS_CIPHER_CHACHA20_POLY1305 == ((mbedtls_cipher_type_t) ctx->cipher_info->type)) { in mbedtls_cipher_aead_decrypt()
1605 if ((iv_len != mbedtls_cipher_info_get_iv_size(ctx->cipher_info)) || in mbedtls_cipher_aead_decrypt()
1642 (MBEDTLS_MODE_KW == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) || in mbedtls_cipher_auth_encrypt_ext()
1643 MBEDTLS_MODE_KWP == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode))) { in mbedtls_cipher_auth_encrypt_ext()
1645 (MBEDTLS_MODE_KW == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) ? in mbedtls_cipher_auth_encrypt_ext()
1693 (MBEDTLS_MODE_KW == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) || in mbedtls_cipher_auth_decrypt_ext()
1694 MBEDTLS_MODE_KWP == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode))) { in mbedtls_cipher_auth_decrypt_ext()
1696 (MBEDTLS_MODE_KW == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) ? in mbedtls_cipher_auth_decrypt_ext()