Lines Matching full:if

14 #if defined(MBEDTLS_CIPHER_C)
26 #if defined(MBEDTLS_CHACHAPOLY_C)
30 #if defined(MBEDTLS_GCM_C)
34 #if defined(MBEDTLS_CCM_C)
38 #if defined(MBEDTLS_CHACHA20_C)
42 #if defined(MBEDTLS_CMAC_C)
46 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_DEPRECATED_REMOVED)
50 #if defined(MBEDTLS_NIST_KW_C)
69 if (!supported_init) { in mbedtls_cipher_list()
91 if (def->type == cipher_type) { in mbedtls_cipher_info_from_type()
104 if (NULL == cipher_name) { in mbedtls_cipher_info_from_string()
109 if (!strcmp(def->info->name, cipher_name)) { in mbedtls_cipher_info_from_string()
125 if (mbedtls_cipher_get_base(def->info)->cipher == cipher_id && in mbedtls_cipher_info_from_values()
135 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_DEPRECATED_REMOVED)
190 if (taglen == 0) { in mbedtls_psa_translate_cipher_mode()
208 if (ctx == NULL) { in mbedtls_cipher_free()
212 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_DEPRECATED_REMOVED) in mbedtls_cipher_free()
213 if (ctx->psa_enabled == 1) { in mbedtls_cipher_free()
214 if (ctx->cipher_ctx != NULL) { in mbedtls_cipher_free()
218 if (cipher_psa->slot_state == MBEDTLS_CIPHER_PSA_KEY_OWNED) { in mbedtls_cipher_free()
231 #if defined(MBEDTLS_CMAC_C) in mbedtls_cipher_free()
232 if (ctx->cmac_ctx) { in mbedtls_cipher_free()
238 if (ctx->cipher_ctx) { in mbedtls_cipher_free()
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()
256 if (ctx->cipher_ctx == NULL) { in mbedtls_cipher_setup()
266 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_DEPRECATED_REMOVED)
274 if (NULL == cipher_info || NULL == ctx) { in mbedtls_cipher_setup_psa()
281 if (alg == 0) { 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()
291 if (cipher_psa == NULL) { in mbedtls_cipher_setup_psa()
307 if (operation != MBEDTLS_ENCRYPT && operation != MBEDTLS_DECRYPT) { in mbedtls_cipher_setkey()
310 if (ctx->cipher_info == NULL) { in mbedtls_cipher_setkey()
313 #if defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT) in mbedtls_cipher_setkey()
314 if (MBEDTLS_MODE_ECB == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode) && in mbedtls_cipher_setkey()
320 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_DEPRECATED_REMOVED) in mbedtls_cipher_setkey()
321 if (ctx->psa_enabled == 1) { in mbedtls_cipher_setkey()
332 if (key_bitlen % 8 != 0) { in mbedtls_cipher_setkey()
337 if (cipher_psa->slot_state != MBEDTLS_CIPHER_PSA_KEY_UNSET) { in mbedtls_cipher_setkey()
343 if (key_type == 0) { in mbedtls_cipher_setkey()
378 if ((ctx->cipher_info->flags & MBEDTLS_CIPHER_VARIABLE_KEY_LEN) == 0 && in mbedtls_cipher_setkey()
386 #if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT) in mbedtls_cipher_setkey()
390 if (MBEDTLS_ENCRYPT == operation || in mbedtls_cipher_setkey()
398 if (MBEDTLS_DECRYPT == operation) { in mbedtls_cipher_setkey()
403 if (operation == MBEDTLS_ENCRYPT || operation == MBEDTLS_DECRYPT) { in mbedtls_cipher_setkey()
418 if (ctx->cipher_info == NULL) { in mbedtls_cipher_set_iv()
421 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_DEPRECATED_REMOVED) in mbedtls_cipher_set_iv()
422 if (ctx->psa_enabled == 1) { in mbedtls_cipher_set_iv()
431 if (iv_len > MBEDTLS_MAX_IV_LENGTH) { in mbedtls_cipher_set_iv()
435 if ((ctx->cipher_info->flags & MBEDTLS_CIPHER_VARIABLE_IV_LEN) != 0) { in mbedtls_cipher_set_iv()
441 if (actual_iv_size > iv_len) { in mbedtls_cipher_set_iv()
446 #if defined(MBEDTLS_CHACHA20_C) in mbedtls_cipher_set_iv()
447 if (((mbedtls_cipher_type_t) ctx->cipher_info->type) == MBEDTLS_CIPHER_CHACHA20) { in mbedtls_cipher_set_iv()
451 if (iv_len != 12) { in mbedtls_cipher_set_iv()
455 if (0 != mbedtls_chacha20_starts((mbedtls_chacha20_context *) ctx->cipher_ctx, in mbedtls_cipher_set_iv()
461 #if defined(MBEDTLS_CHACHAPOLY_C) in mbedtls_cipher_set_iv()
462 if (((mbedtls_cipher_type_t) ctx->cipher_info->type) == MBEDTLS_CIPHER_CHACHA20_POLY1305 && in mbedtls_cipher_set_iv()
469 #if defined(MBEDTLS_GCM_C) in mbedtls_cipher_set_iv()
470 if (MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_set_iv()
477 #if defined(MBEDTLS_CCM_C) 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()
485 if (set_lengths_result != 0) { in mbedtls_cipher_set_iv()
489 if (ctx->operation == MBEDTLS_DECRYPT) { in mbedtls_cipher_set_iv()
491 } else if (ctx->operation == MBEDTLS_ENCRYPT) { in mbedtls_cipher_set_iv()
503 if (actual_iv_size != 0) { in mbedtls_cipher_set_iv()
513 if (ctx->cipher_info == NULL) { in mbedtls_cipher_reset()
517 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_DEPRECATED_REMOVED) in mbedtls_cipher_reset()
518 if (ctx->psa_enabled == 1) { in mbedtls_cipher_reset()
530 #if defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CHACHAPOLY_C)
534 if (ctx->cipher_info == NULL) { in mbedtls_cipher_update_ad()
538 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_DEPRECATED_REMOVED) in mbedtls_cipher_update_ad()
539 if (ctx->psa_enabled == 1) { in mbedtls_cipher_update_ad()
547 #if defined(MBEDTLS_GCM_C) in mbedtls_cipher_update_ad()
548 if (MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_update_ad()
554 #if defined(MBEDTLS_CHACHAPOLY_C) in mbedtls_cipher_update_ad()
555 if (MBEDTLS_CIPHER_CHACHA20_POLY1305 == ((mbedtls_cipher_type_t) ctx->cipher_info->type)) { in mbedtls_cipher_update_ad()
566 if (result != 0) { in mbedtls_cipher_update_ad()
585 if (ctx->cipher_info == NULL) { in mbedtls_cipher_update()
589 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_DEPRECATED_REMOVED) in mbedtls_cipher_update()
590 if (ctx->psa_enabled == 1) { in mbedtls_cipher_update()
600 if (0 == block_size) { in mbedtls_cipher_update()
604 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_ECB) { in mbedtls_cipher_update()
605 if (ilen != block_size) { in mbedtls_cipher_update()
611 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->ecb_func(ctx->cipher_ctx, in mbedtls_cipher_update()
620 #if defined(MBEDTLS_GCM_C) in mbedtls_cipher_update()
621 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_GCM) { in mbedtls_cipher_update()
628 #if defined(MBEDTLS_CCM_C) in mbedtls_cipher_update()
629 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_CCM_STAR_NO_TAG) { in mbedtls_cipher_update()
636 #if defined(MBEDTLS_CHACHAPOLY_C) in mbedtls_cipher_update()
637 if (((mbedtls_cipher_type_t) ctx->cipher_info->type) == MBEDTLS_CIPHER_CHACHA20_POLY1305) { in mbedtls_cipher_update()
644 if (input == output && in mbedtls_cipher_update()
649 #if defined(MBEDTLS_CIPHER_MODE_CBC) in mbedtls_cipher_update()
650 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_CBC) { in mbedtls_cipher_update()
654 * If there is not enough data for a full block, cache it. in mbedtls_cipher_update()
656 if ((ctx->operation == MBEDTLS_DECRYPT && NULL != ctx->add_padding && in mbedtls_cipher_update()
672 if (0 != ctx->unprocessed_len) { in mbedtls_cipher_update()
678 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->cbc_func(ctx->cipher_ctx, in mbedtls_cipher_update()
698 if (0 != ilen) { in mbedtls_cipher_update()
704 if (copy_len == 0 && in mbedtls_cipher_update()
720 if (ilen) { in mbedtls_cipher_update()
721 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->cbc_func(ctx->cipher_ctx, in mbedtls_cipher_update()
736 #if defined(MBEDTLS_CIPHER_MODE_CFB) 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()
752 #if defined(MBEDTLS_CIPHER_MODE_OFB) 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()
768 #if defined(MBEDTLS_CIPHER_MODE_CTR) 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()
785 #if defined(MBEDTLS_CIPHER_MODE_XTS) in mbedtls_cipher_update()
786 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) == MBEDTLS_MODE_XTS) { in mbedtls_cipher_update()
787 if (ctx->unprocessed_len > 0) { in mbedtls_cipher_update()
798 if (ret != 0) { in mbedtls_cipher_update()
808 #if defined(MBEDTLS_CIPHER_MODE_STREAM) 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()
825 #if defined(MBEDTLS_CIPHER_MODE_WITH_PADDING)
826 #if defined(MBEDTLS_CIPHER_PADDING_PKCS7)
847 if (NULL == input || NULL == data_len) { in get_pkcs_padding()
870 #if defined(MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS)
889 if (NULL == input || NULL == data_len) { in get_one_and_zeros_padding()
914 #if defined(MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN)
937 if (NULL == input || NULL == data_len) { in get_zeros_and_len_padding()
961 #if defined(MBEDTLS_CIPHER_PADDING_ZEROS)
977 if (NULL == input || NULL == data_len) { in get_zeros_padding()
1001 if (NULL == input || NULL == data_len) { in get_no_padding()
1014 if (ctx->cipher_info == NULL) { in mbedtls_cipher_finish()
1018 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_DEPRECATED_REMOVED) in mbedtls_cipher_finish()
1019 if (ctx->psa_enabled == 1) { in mbedtls_cipher_finish()
1029 #if defined(MBEDTLS_CIPHER_MODE_WITH_PADDING) in mbedtls_cipher_finish()
1032 if (MBEDTLS_MODE_CBC == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_finish()
1033 if (ctx->get_padding == NULL) { in mbedtls_cipher_finish()
1039 if (MBEDTLS_MODE_CFB == ((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()
1054 if (MBEDTLS_MODE_ECB == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_finish()
1055 if (ctx->unprocessed_len != 0) { in mbedtls_cipher_finish()
1062 #if defined(MBEDTLS_CIPHER_MODE_CBC) in mbedtls_cipher_finish()
1063 if (MBEDTLS_MODE_CBC == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_finish()
1066 if (MBEDTLS_ENCRYPT == ctx->operation) { in mbedtls_cipher_finish()
1068 if (NULL == ctx->add_padding) { in mbedtls_cipher_finish()
1069 if (0 != ctx->unprocessed_len) { in mbedtls_cipher_finish()
1078 } else if (mbedtls_cipher_get_block_size(ctx) != ctx->unprocessed_len) { in mbedtls_cipher_finish()
1081 * or an empty block if no padding in mbedtls_cipher_finish()
1083 if (NULL == ctx->add_padding && 0 == ctx->unprocessed_len) { in mbedtls_cipher_finish()
1091 if (0 != (ret = mbedtls_cipher_get_base(ctx->cipher_info)->cbc_func(ctx->cipher_ctx, in mbedtls_cipher_finish()
1102 if (MBEDTLS_DECRYPT == ctx->operation) { in mbedtls_cipher_finish()
1118 #if defined(MBEDTLS_CIPHER_MODE_WITH_PADDING)
1122 if (NULL == ctx->cipher_info || in mbedtls_cipher_set_padding_mode()
1127 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_DEPRECATED_REMOVED) in mbedtls_cipher_set_padding_mode()
1128 if (ctx->psa_enabled == 1) { in mbedtls_cipher_set_padding_mode()
1132 if (mode != MBEDTLS_PADDING_NONE) { in mbedtls_cipher_set_padding_mode()
1141 #if defined(MBEDTLS_CIPHER_PADDING_PKCS7) in mbedtls_cipher_set_padding_mode()
1147 #if defined(MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS) in mbedtls_cipher_set_padding_mode()
1153 #if defined(MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN) in mbedtls_cipher_set_padding_mode()
1159 #if defined(MBEDTLS_CIPHER_PADDING_ZEROS) in mbedtls_cipher_set_padding_mode()
1178 #if defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CHACHAPOLY_C)
1182 if (ctx->cipher_info == NULL) { in mbedtls_cipher_write_tag()
1186 if (MBEDTLS_ENCRYPT != ctx->operation) { in mbedtls_cipher_write_tag()
1190 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_DEPRECATED_REMOVED) in mbedtls_cipher_write_tag()
1191 if (ctx->psa_enabled == 1) { in mbedtls_cipher_write_tag()
1199 #if defined(MBEDTLS_GCM_C) in mbedtls_cipher_write_tag()
1200 if (MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_write_tag()
1210 #if defined(MBEDTLS_CHACHAPOLY_C) in mbedtls_cipher_write_tag()
1211 if (MBEDTLS_CIPHER_CHACHA20_POLY1305 == ((mbedtls_cipher_type_t) ctx->cipher_info->type)) { in mbedtls_cipher_write_tag()
1213 if (tag_len != 16U) { in mbedtls_cipher_write_tag()
1231 if (ctx->cipher_info == NULL) { in mbedtls_cipher_check_tag()
1235 if (MBEDTLS_DECRYPT != ctx->operation) { in mbedtls_cipher_check_tag()
1239 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_DEPRECATED_REMOVED) in mbedtls_cipher_check_tag()
1240 if (ctx->psa_enabled == 1) { in mbedtls_cipher_check_tag()
1251 #if defined(MBEDTLS_GCM_C) in mbedtls_cipher_check_tag()
1252 if (MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_check_tag()
1257 if (tag_len > sizeof(check_tag)) { in mbedtls_cipher_check_tag()
1261 if (0 != (ret = mbedtls_gcm_finish( in mbedtls_cipher_check_tag()
1269 if (mbedtls_ct_memcmp(tag, check_tag, tag_len) != 0) { in mbedtls_cipher_check_tag()
1276 #if defined(MBEDTLS_CHACHAPOLY_C) in mbedtls_cipher_check_tag()
1277 if (MBEDTLS_CIPHER_CHACHA20_POLY1305 == ((mbedtls_cipher_type_t) ctx->cipher_info->type)) { in mbedtls_cipher_check_tag()
1279 if (tag_len != sizeof(check_tag)) { in mbedtls_cipher_check_tag()
1285 if (ret != 0) { in mbedtls_cipher_check_tag()
1290 if (mbedtls_ct_memcmp(tag, check_tag, tag_len) != 0) { in mbedtls_cipher_check_tag()
1314 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_DEPRECATED_REMOVED) in mbedtls_cipher_crypt()
1315 if (ctx->psa_enabled == 1) { in mbedtls_cipher_crypt()
1317 * a key has been set. If not, the key slot will in mbedtls_cipher_crypt()
1328 if (ctx->operation == MBEDTLS_DECRYPT) { in mbedtls_cipher_crypt()
1332 } else if (ctx->operation == MBEDTLS_ENCRYPT) { in mbedtls_cipher_crypt()
1344 if (status != PSA_SUCCESS) { in mbedtls_cipher_crypt()
1348 if (((mbedtls_cipher_mode_t) ctx->cipher_info->mode) != MBEDTLS_MODE_ECB) { in mbedtls_cipher_crypt()
1350 if (status != PSA_SUCCESS) { in mbedtls_cipher_crypt()
1358 if (status != PSA_SUCCESS) { in mbedtls_cipher_crypt()
1365 if (status != PSA_SUCCESS) { in mbedtls_cipher_crypt()
1374 if ((ret = mbedtls_cipher_set_iv(ctx, iv, iv_len)) != 0) { in mbedtls_cipher_crypt()
1378 if ((ret = mbedtls_cipher_reset(ctx)) != 0) { in mbedtls_cipher_crypt()
1382 if ((ret = mbedtls_cipher_update(ctx, input, ilen, in mbedtls_cipher_crypt()
1387 if ((ret = mbedtls_cipher_finish(ctx, output + *olen, in mbedtls_cipher_crypt()
1397 #if defined(MBEDTLS_CIPHER_MODE_AEAD)
1409 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_DEPRECATED_REMOVED) in mbedtls_cipher_aead_encrypt()
1410 if (ctx->psa_enabled == 1) { in mbedtls_cipher_aead_encrypt()
1412 * a key has been set. If not, the key slot will in mbedtls_cipher_aead_encrypt()
1423 if (output == NULL || tag != output + ilen) { in mbedtls_cipher_aead_encrypt()
1433 if (status != PSA_SUCCESS) { in mbedtls_cipher_aead_encrypt()
1442 #if defined(MBEDTLS_GCM_C) in mbedtls_cipher_aead_encrypt()
1443 if (MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_aead_encrypt()
1450 #if defined(MBEDTLS_CCM_C) in mbedtls_cipher_aead_encrypt()
1451 if (MBEDTLS_MODE_CCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_aead_encrypt()
1458 #if defined(MBEDTLS_CHACHAPOLY_C) 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()
1486 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_DEPRECATED_REMOVED) in mbedtls_cipher_aead_decrypt()
1487 if (ctx->psa_enabled == 1) { in mbedtls_cipher_aead_decrypt()
1489 * a key has been set. If not, the key slot will in mbedtls_cipher_aead_decrypt()
1500 if (input == NULL || tag != input + ilen) { in mbedtls_cipher_aead_decrypt()
1510 if (status == PSA_ERROR_INVALID_SIGNATURE) { in mbedtls_cipher_aead_decrypt()
1512 } else if (status != PSA_SUCCESS) { in mbedtls_cipher_aead_decrypt()
1520 #if defined(MBEDTLS_GCM_C) in mbedtls_cipher_aead_decrypt()
1521 if (MBEDTLS_MODE_GCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_aead_decrypt()
1529 if (ret == MBEDTLS_ERR_GCM_AUTH_FAILED) { in mbedtls_cipher_aead_decrypt()
1536 #if defined(MBEDTLS_CCM_C) in mbedtls_cipher_aead_decrypt()
1537 if (MBEDTLS_MODE_CCM == ((mbedtls_cipher_mode_t) ctx->cipher_info->mode)) { in mbedtls_cipher_aead_decrypt()
1545 if (ret == MBEDTLS_ERR_CCM_AUTH_FAILED) { in mbedtls_cipher_aead_decrypt()
1552 #if defined(MBEDTLS_CHACHAPOLY_C) 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()
1566 if (ret == MBEDTLS_ERR_CHACHAPOLY_AUTH_FAILED) { in mbedtls_cipher_aead_decrypt()
1578 #if defined(MBEDTLS_CIPHER_MODE_AEAD) || defined(MBEDTLS_NIST_KW_C)
1589 #if defined(MBEDTLS_NIST_KW_C) in mbedtls_cipher_auth_encrypt_ext()
1590 if ( in mbedtls_cipher_auth_encrypt_ext()
1591 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_DEPRECATED_REMOVED) in mbedtls_cipher_auth_encrypt_ext()
1602 if (iv_len != 0 || tag_len != 0 || ad_len != 0) { in mbedtls_cipher_auth_encrypt_ext()
1614 #if defined(MBEDTLS_CIPHER_MODE_AEAD) in mbedtls_cipher_auth_encrypt_ext()
1616 if (output_len < ilen + tag_len) { in mbedtls_cipher_auth_encrypt_ext()
1640 #if defined(MBEDTLS_NIST_KW_C) in mbedtls_cipher_auth_decrypt_ext()
1641 if ( in mbedtls_cipher_auth_decrypt_ext()
1642 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_DEPRECATED_REMOVED) in mbedtls_cipher_auth_decrypt_ext()
1653 if (iv_len != 0 || tag_len != 0 || ad_len != 0) { in mbedtls_cipher_auth_decrypt_ext()
1665 #if defined(MBEDTLS_CIPHER_MODE_AEAD) in mbedtls_cipher_auth_decrypt_ext()
1667 if (ilen < tag_len || output_len < ilen - tag_len) { in mbedtls_cipher_auth_decrypt_ext()