Lines Matching refs:cipher_info
239 mbedtls_cipher_get_base(ctx->cipher_info)->ctx_free_func(ctx->cipher_ctx); in mbedtls_cipher_free()
246 const mbedtls_cipher_info_t *cipher_info) in mbedtls_cipher_setup() argument
248 if (cipher_info == NULL) { in mbedtls_cipher_setup()
254 if (mbedtls_cipher_get_base(cipher_info)->ctx_alloc_func != NULL) { in mbedtls_cipher_setup()
255 ctx->cipher_ctx = mbedtls_cipher_get_base(cipher_info)->ctx_alloc_func(); in mbedtls_cipher_setup()
261 ctx->cipher_info = cipher_info; in mbedtls_cipher_setup()
268 const mbedtls_cipher_info_t *cipher_info, in mbedtls_cipher_setup_psa() argument
274 if (NULL == cipher_info || NULL == ctx) { in mbedtls_cipher_setup_psa()
280 alg = mbedtls_psa_translate_cipher_mode(((mbedtls_cipher_mode_t) cipher_info->mode), taglen); in mbedtls_cipher_setup_psa()
284 if (mbedtls_psa_translate_cipher_type(((mbedtls_cipher_type_t) cipher_info->type)) == 0) { in mbedtls_cipher_setup_psa()
296 ctx->cipher_info = cipher_info; in mbedtls_cipher_setup_psa()
310 if (ctx->cipher_info == NULL) { in mbedtls_cipher_setkey()
314 if (MBEDTLS_MODE_ECB == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) && in mbedtls_cipher_setkey()
342 ((mbedtls_cipher_type_t) ctx->cipher_info->type)); in mbedtls_cipher_setkey()
378 if ((ctx->cipher_info->flags & MBEDTLS_CIPHER_VARIABLE_KEY_LEN) == 0 && in mbedtls_cipher_setkey()
379 (int) mbedtls_cipher_info_get_key_bitlen(ctx->cipher_info) != key_bitlen) { in mbedtls_cipher_setkey()
391 MBEDTLS_MODE_CFB == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) || in mbedtls_cipher_setkey()
392 MBEDTLS_MODE_OFB == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) || in mbedtls_cipher_setkey()
393 MBEDTLS_MODE_CTR == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_setkey()
394 return mbedtls_cipher_get_base(ctx->cipher_info)->setkey_enc_func(ctx->cipher_ctx, key, in mbedtls_cipher_setkey()
399 return mbedtls_cipher_get_base(ctx->cipher_info)->setkey_dec_func(ctx->cipher_ctx, key, in mbedtls_cipher_setkey()
404 return mbedtls_cipher_get_base(ctx->cipher_info)->setkey_enc_func(ctx->cipher_ctx, key, in mbedtls_cipher_setkey()
418 if (ctx->cipher_info == NULL) { in mbedtls_cipher_set_iv()
435 if ((ctx->cipher_info->flags & MBEDTLS_CIPHER_VARIABLE_IV_LEN) != 0) { in mbedtls_cipher_set_iv()
438 actual_iv_size = mbedtls_cipher_info_get_iv_size(ctx->cipher_info); in mbedtls_cipher_set_iv()
447 if (((mbedtls_cipher_type_t) ctx->cipher_info->type) == MBEDTLS_CIPHER_CHACHA20) { in mbedtls_cipher_set_iv()
462 if (((mbedtls_cipher_type_t) ctx->cipher_info->type) == MBEDTLS_CIPHER_CHACHA20_POLY1305 && in mbedtls_cipher_set_iv()
470 if (MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_set_iv()
478 if (MBEDTLS_MODE_CCM_STAR_NO_TAG == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_set_iv()
513 if (ctx->cipher_info == NULL) { in mbedtls_cipher_reset()
534 if (ctx->cipher_info == NULL) { in mbedtls_cipher_update_ad()
548 if (MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_update_ad()
555 if (MBEDTLS_CIPHER_CHACHA20_POLY1305 == ((mbedtls_cipher_type_t) ctx->cipher_info->type)) { in mbedtls_cipher_update_ad()
585 if (ctx->cipher_info == NULL) { in mbedtls_cipher_update()
604 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_ECB) { in mbedtls_cipher_update()
611 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->ecb_func(ctx->cipher_ctx, in mbedtls_cipher_update()
621 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_GCM) { in mbedtls_cipher_update()
629 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_CCM_STAR_NO_TAG) { in mbedtls_cipher_update()
637 if (((mbedtls_cipher_type_t) ctx->cipher_info->type) == MBEDTLS_CIPHER_CHACHA20_POLY1305) { in mbedtls_cipher_update()
650 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_CBC) { in mbedtls_cipher_update()
678 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->cbc_func(ctx->cipher_ctx, in mbedtls_cipher_update()
721 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->cbc_func(ctx->cipher_ctx, in mbedtls_cipher_update()
737 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_CFB) { in mbedtls_cipher_update()
738 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->cfb_func(ctx->cipher_ctx, in mbedtls_cipher_update()
753 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_OFB) { in mbedtls_cipher_update()
754 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->ofb_func(ctx->cipher_ctx, in mbedtls_cipher_update()
769 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_CTR) { in mbedtls_cipher_update()
770 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->ctr_func(ctx->cipher_ctx, in mbedtls_cipher_update()
786 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_XTS) { in mbedtls_cipher_update()
792 ret = mbedtls_cipher_get_base(ctx->cipher_info)->xts_func(ctx->cipher_ctx, in mbedtls_cipher_update()
809 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_STREAM) { in mbedtls_cipher_update()
810 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->stream_func(ctx->cipher_ctx, in mbedtls_cipher_update()
1014 if (ctx->cipher_info == NULL) { in mbedtls_cipher_finish()
1032 if (MBEDTLS_MODE_CBC == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_finish()
1039 if (MBEDTLS_MODE_CFB == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) || in mbedtls_cipher_finish()
1040 MBEDTLS_MODE_OFB == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) || in mbedtls_cipher_finish()
1041 MBEDTLS_MODE_CTR == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) || in mbedtls_cipher_finish()
1042 MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) || in mbedtls_cipher_finish()
1043 MBEDTLS_MODE_CCM_STAR_NO_TAG == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) || in mbedtls_cipher_finish()
1044 MBEDTLS_MODE_XTS == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) || in mbedtls_cipher_finish()
1045 MBEDTLS_MODE_STREAM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_finish()
1049 if ((MBEDTLS_CIPHER_CHACHA20 == ((mbedtls_cipher_type_t) ctx->cipher_info->type)) || in mbedtls_cipher_finish()
1050 (MBEDTLS_CIPHER_CHACHA20_POLY1305 == ((mbedtls_cipher_type_t) ctx->cipher_info->type))) { in mbedtls_cipher_finish()
1054 if (MBEDTLS_MODE_ECB == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_finish()
1063 if (MBEDTLS_MODE_CBC == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_finish()
1091 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->cbc_func(ctx->cipher_ctx, in mbedtls_cipher_finish()
1122 if (NULL == ctx->cipher_info || in mbedtls_cipher_set_padding_mode()
1123 MBEDTLS_MODE_CBC != ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_set_padding_mode()
1182 if (ctx->cipher_info == NULL) { in mbedtls_cipher_write_tag()
1200 if (MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_write_tag()
1211 if (MBEDTLS_CIPHER_CHACHA20_POLY1305 == ((mbedtls_cipher_type_t) ctx->cipher_info->type)) { in mbedtls_cipher_write_tag()
1231 if (ctx->cipher_info == NULL) { in mbedtls_cipher_check_tag()
1252 if (MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_check_tag()
1277 if (MBEDTLS_CIPHER_CHACHA20_POLY1305 == ((mbedtls_cipher_type_t) ctx->cipher_info->type)) { in mbedtls_cipher_check_tag()
1348 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) != MBEDTLS_MODE_ECB) { in mbedtls_cipher_crypt()
1443 if (MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_aead_encrypt()
1451 if (MBEDTLS_MODE_CCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_aead_encrypt()
1459 if (MBEDTLS_CIPHER_CHACHA20_POLY1305 == ((mbedtls_cipher_type_t) ctx->cipher_info->type)) { in mbedtls_cipher_aead_encrypt()
1461 if ((iv_len != mbedtls_cipher_info_get_iv_size(ctx->cipher_info)) || in mbedtls_cipher_aead_encrypt()
1521 if (MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_aead_decrypt()
1537 if (MBEDTLS_MODE_CCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_aead_decrypt()
1553 if (MBEDTLS_CIPHER_CHACHA20_POLY1305 == ((mbedtls_cipher_type_t) ctx->cipher_info->type)) { in mbedtls_cipher_aead_decrypt()
1557 if ((iv_len != mbedtls_cipher_info_get_iv_size(ctx->cipher_info)) || in mbedtls_cipher_aead_decrypt()
1594 (MBEDTLS_MODE_KW == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) || in mbedtls_cipher_auth_encrypt_ext()
1595 MBEDTLS_MODE_KWP == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode))) { in mbedtls_cipher_auth_encrypt_ext()
1597 (MBEDTLS_MODE_KW == ((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_decrypt_ext()
1646 MBEDTLS_MODE_KWP == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode))) { in mbedtls_cipher_auth_decrypt_ext()
1648 (MBEDTLS_MODE_KW == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) ? in mbedtls_cipher_auth_decrypt_ext()