Lines Matching full:if
30 #if defined(MBEDTLS_MD_LIGHT)
44 #if defined(MBEDTLS_PSA_CRYPTO_C)
50 #if defined(MBEDTLS_MD_SOME_PSA)
58 #if defined(MBEDTLS_FS_IO)
63 #if defined(MBEDTLS_PSA_CRYPTO_C) && MBEDTLS_MD_MAX_SIZE < PSA_HASH_MAX_SIZE
67 #if defined(MBEDTLS_MD_C)
73 #if defined(MBEDTLS_MD_CAN_MD5)
79 #if defined(MBEDTLS_MD_CAN_RIPEMD160)
85 #if defined(MBEDTLS_MD_CAN_SHA1)
91 #if defined(MBEDTLS_MD_CAN_SHA224)
97 #if defined(MBEDTLS_MD_CAN_SHA256)
103 #if defined(MBEDTLS_MD_CAN_SHA384)
109 #if defined(MBEDTLS_MD_CAN_SHA512)
115 #if defined(MBEDTLS_MD_CAN_SHA3_224)
121 #if defined(MBEDTLS_MD_CAN_SHA3_256)
127 #if defined(MBEDTLS_MD_CAN_SHA3_384)
133 #if defined(MBEDTLS_MD_CAN_SHA3_512)
142 #if defined(MBEDTLS_MD_CAN_MD5) in mbedtls_md_info_from_type()
146 #if defined(MBEDTLS_MD_CAN_RIPEMD160) in mbedtls_md_info_from_type()
150 #if defined(MBEDTLS_MD_CAN_SHA1) in mbedtls_md_info_from_type()
154 #if defined(MBEDTLS_MD_CAN_SHA224) in mbedtls_md_info_from_type()
158 #if defined(MBEDTLS_MD_CAN_SHA256) in mbedtls_md_info_from_type()
162 #if defined(MBEDTLS_MD_CAN_SHA384) in mbedtls_md_info_from_type()
166 #if defined(MBEDTLS_MD_CAN_SHA512) in mbedtls_md_info_from_type()
170 #if defined(MBEDTLS_MD_CAN_SHA3_224) in mbedtls_md_info_from_type()
174 #if defined(MBEDTLS_MD_CAN_SHA3_256) in mbedtls_md_info_from_type()
178 #if defined(MBEDTLS_MD_CAN_SHA3_384) in mbedtls_md_info_from_type()
182 #if defined(MBEDTLS_MD_CAN_SHA3_512) in mbedtls_md_info_from_type()
191 #if defined(MBEDTLS_MD_SOME_PSA)
195 #if defined(MBEDTLS_MD_MD5_VIA_PSA) in psa_alg_of_md()
199 #if defined(MBEDTLS_MD_RIPEMD160_VIA_PSA) in psa_alg_of_md()
203 #if defined(MBEDTLS_MD_SHA1_VIA_PSA) in psa_alg_of_md()
207 #if defined(MBEDTLS_MD_SHA224_VIA_PSA) in psa_alg_of_md()
211 #if defined(MBEDTLS_MD_SHA256_VIA_PSA) in psa_alg_of_md()
215 #if defined(MBEDTLS_MD_SHA384_VIA_PSA) in psa_alg_of_md()
219 #if defined(MBEDTLS_MD_SHA512_VIA_PSA) in psa_alg_of_md()
223 #if defined(MBEDTLS_MD_SHA3_224_VIA_PSA) in psa_alg_of_md()
227 #if defined(MBEDTLS_MD_SHA3_256_VIA_PSA) in psa_alg_of_md()
231 #if defined(MBEDTLS_MD_SHA3_384_VIA_PSA) in psa_alg_of_md()
235 #if defined(MBEDTLS_MD_SHA3_512_VIA_PSA) in psa_alg_of_md()
247 if (alg == PSA_ALG_NONE) { in md_can_use_psa()
257 /* Note: this sets engine (if present) to MBEDTLS_MD_ENGINE_LEGACY */ in mbedtls_md_init()
263 if (ctx == NULL || ctx->md_info == NULL) { in mbedtls_md_free()
267 if (ctx->md_ctx != NULL) { in mbedtls_md_free()
268 #if defined(MBEDTLS_MD_SOME_PSA) in mbedtls_md_free()
269 if (ctx->engine == MBEDTLS_MD_ENGINE_PSA) { in mbedtls_md_free()
274 #if defined(MBEDTLS_MD5_C) in mbedtls_md_free()
279 #if defined(MBEDTLS_RIPEMD160_C) in mbedtls_md_free()
284 #if defined(MBEDTLS_SHA1_C) in mbedtls_md_free()
289 #if defined(MBEDTLS_SHA224_C) in mbedtls_md_free()
294 #if defined(MBEDTLS_SHA256_C) in mbedtls_md_free()
299 #if defined(MBEDTLS_SHA384_C) in mbedtls_md_free()
304 #if defined(MBEDTLS_SHA512_C) in mbedtls_md_free()
309 #if defined(MBEDTLS_SHA3_C) in mbedtls_md_free()
324 #if defined(MBEDTLS_MD_C) in mbedtls_md_free()
325 if (ctx->hmac_ctx != NULL) { in mbedtls_md_free()
337 if (dst == NULL || dst->md_info == NULL || in mbedtls_md_clone()
343 #if defined(MBEDTLS_MD_SOME_PSA) in mbedtls_md_clone()
344 if (src->engine != dst->engine) { in mbedtls_md_clone()
352 if (src->engine == MBEDTLS_MD_ENGINE_PSA) { in mbedtls_md_clone()
359 #if defined(MBEDTLS_MD5_C) in mbedtls_md_clone()
364 #if defined(MBEDTLS_RIPEMD160_C) in mbedtls_md_clone()
369 #if defined(MBEDTLS_SHA1_C) in mbedtls_md_clone()
374 #if defined(MBEDTLS_SHA224_C) in mbedtls_md_clone()
379 #if defined(MBEDTLS_SHA256_C) in mbedtls_md_clone()
384 #if defined(MBEDTLS_SHA384_C) in mbedtls_md_clone()
389 #if defined(MBEDTLS_SHA512_C) in mbedtls_md_clone()
394 #if defined(MBEDTLS_SHA3_C) in mbedtls_md_clone()
412 if (ctx->md_ctx == NULL) \
420 #if defined(MBEDTLS_MD_C) in mbedtls_md_setup()
421 if (ctx == NULL) { in mbedtls_md_setup()
425 if (md_info == NULL) { in mbedtls_md_setup()
431 #if defined(MBEDTLS_MD_C) in mbedtls_md_setup()
434 if (hmac != 0) { in mbedtls_md_setup()
439 #if defined(MBEDTLS_MD_SOME_PSA) in mbedtls_md_setup()
440 if (md_can_use_psa(ctx->md_info)) { in mbedtls_md_setup()
442 if (ctx->md_ctx == NULL) { in mbedtls_md_setup()
449 #if defined(MBEDTLS_MD5_C) in mbedtls_md_setup()
454 #if defined(MBEDTLS_RIPEMD160_C) in mbedtls_md_setup()
459 #if defined(MBEDTLS_SHA1_C) in mbedtls_md_setup()
464 #if defined(MBEDTLS_SHA224_C) in mbedtls_md_setup()
469 #if defined(MBEDTLS_SHA256_C) in mbedtls_md_setup()
474 #if defined(MBEDTLS_SHA384_C) in mbedtls_md_setup()
479 #if defined(MBEDTLS_SHA512_C) in mbedtls_md_setup()
484 #if defined(MBEDTLS_SHA3_C) in mbedtls_md_setup()
496 #if defined(MBEDTLS_MD_C) in mbedtls_md_setup()
497 if (hmac != 0) { in mbedtls_md_setup()
499 if (ctx->hmac_ctx == NULL) { in mbedtls_md_setup()
512 #if defined(MBEDTLS_MD_C) in mbedtls_md_starts()
513 if (ctx == NULL || ctx->md_info == NULL) { in mbedtls_md_starts()
518 #if defined(MBEDTLS_MD_SOME_PSA) in mbedtls_md_starts()
519 if (ctx->engine == MBEDTLS_MD_ENGINE_PSA) { in mbedtls_md_starts()
528 #if defined(MBEDTLS_MD5_C) in mbedtls_md_starts()
532 #if defined(MBEDTLS_RIPEMD160_C) in mbedtls_md_starts()
536 #if defined(MBEDTLS_SHA1_C) in mbedtls_md_starts()
540 #if defined(MBEDTLS_SHA224_C) in mbedtls_md_starts()
544 #if defined(MBEDTLS_SHA256_C) in mbedtls_md_starts()
548 #if defined(MBEDTLS_SHA384_C) in mbedtls_md_starts()
552 #if defined(MBEDTLS_SHA512_C) in mbedtls_md_starts()
556 #if defined(MBEDTLS_SHA3_C) in mbedtls_md_starts()
573 #if defined(MBEDTLS_MD_C) in mbedtls_md_update()
574 if (ctx == NULL || ctx->md_info == NULL) { in mbedtls_md_update()
579 #if defined(MBEDTLS_MD_SOME_PSA) in mbedtls_md_update()
580 if (ctx->engine == MBEDTLS_MD_ENGINE_PSA) { in mbedtls_md_update()
587 #if defined(MBEDTLS_MD5_C) in mbedtls_md_update()
591 #if defined(MBEDTLS_RIPEMD160_C) in mbedtls_md_update()
595 #if defined(MBEDTLS_SHA1_C) in mbedtls_md_update()
599 #if defined(MBEDTLS_SHA224_C) in mbedtls_md_update()
603 #if defined(MBEDTLS_SHA256_C) in mbedtls_md_update()
607 #if defined(MBEDTLS_SHA384_C) in mbedtls_md_update()
611 #if defined(MBEDTLS_SHA512_C) in mbedtls_md_update()
615 #if defined(MBEDTLS_SHA3_C) in mbedtls_md_update()
629 #if defined(MBEDTLS_MD_C) in mbedtls_md_finish()
630 if (ctx == NULL || ctx->md_info == NULL) { in mbedtls_md_finish()
635 #if defined(MBEDTLS_MD_SOME_PSA) in mbedtls_md_finish()
636 if (ctx->engine == MBEDTLS_MD_ENGINE_PSA) { in mbedtls_md_finish()
645 #if defined(MBEDTLS_MD5_C) in mbedtls_md_finish()
649 #if defined(MBEDTLS_RIPEMD160_C) in mbedtls_md_finish()
653 #if defined(MBEDTLS_SHA1_C) in mbedtls_md_finish()
657 #if defined(MBEDTLS_SHA224_C) in mbedtls_md_finish()
661 #if defined(MBEDTLS_SHA256_C) in mbedtls_md_finish()
665 #if defined(MBEDTLS_SHA384_C) in mbedtls_md_finish()
669 #if defined(MBEDTLS_SHA512_C) in mbedtls_md_finish()
673 #if defined(MBEDTLS_SHA3_C) in mbedtls_md_finish()
688 if (md_info == NULL) { in mbedtls_md()
692 #if defined(MBEDTLS_MD_SOME_PSA) in mbedtls_md()
693 if (md_can_use_psa(md_info)) { in mbedtls_md()
703 #if defined(MBEDTLS_MD5_C) in mbedtls_md()
707 #if defined(MBEDTLS_RIPEMD160_C) in mbedtls_md()
711 #if defined(MBEDTLS_SHA1_C) in mbedtls_md()
715 #if defined(MBEDTLS_SHA224_C) in mbedtls_md()
719 #if defined(MBEDTLS_SHA256_C) in mbedtls_md()
723 #if defined(MBEDTLS_SHA384_C) in mbedtls_md()
727 #if defined(MBEDTLS_SHA512_C) in mbedtls_md()
731 #if defined(MBEDTLS_SHA3_C) in mbedtls_md()
748 if (md_info == NULL) { in mbedtls_md_get_size()
757 if (md_info == NULL) { in mbedtls_md_get_type()
764 #if defined(MBEDTLS_PSA_CRYPTO_C)
777 #if defined(MBEDTLS_MD_C)
784 #if defined(MBEDTLS_MD_CAN_SHA512)
788 #if defined(MBEDTLS_MD_CAN_SHA384)
792 #if defined(MBEDTLS_MD_CAN_SHA256)
795 #if defined(MBEDTLS_MD_CAN_SHA224)
799 #if defined(MBEDTLS_MD_CAN_SHA1)
803 #if defined(MBEDTLS_MD_CAN_RIPEMD160)
807 #if defined(MBEDTLS_MD_CAN_MD5)
811 #if defined(MBEDTLS_MD_CAN_SHA3_224)
815 #if defined(MBEDTLS_MD_CAN_SHA3_256)
819 #if defined(MBEDTLS_MD_CAN_SHA3_384)
823 #if defined(MBEDTLS_MD_CAN_SHA3_512)
841 #if defined(MBEDTLS_MD_CAN_MD5)
844 #if defined(MBEDTLS_MD_CAN_RIPEMD160)
847 #if defined(MBEDTLS_MD_CAN_SHA1)
851 #if defined(MBEDTLS_MD_CAN_SHA224)
854 #if defined(MBEDTLS_MD_CAN_SHA256)
857 #if defined(MBEDTLS_MD_CAN_SHA384)
860 #if defined(MBEDTLS_MD_CAN_SHA512)
863 #if defined(MBEDTLS_MD_CAN_SHA3_224)
866 #if defined(MBEDTLS_MD_CAN_SHA3_256)
869 #if defined(MBEDTLS_MD_CAN_SHA3_384)
872 #if defined(MBEDTLS_MD_CAN_SHA3_512)
880 if (NULL == md_name) { in mbedtls_md_info_from_string()
895 if (md_info == NULL) { in mbedtls_md_get_name()
911 if (ctx == NULL) { in mbedtls_md_info_from_ctx()
918 #if defined(MBEDTLS_FS_IO)
927 if (md_info == NULL) { in mbedtls_md_file()
931 if ((f = fopen(path, "rb")) == NULL) { in mbedtls_md_file()
940 if ((ret = mbedtls_md_setup(&ctx, md_info, 0)) != 0) { in mbedtls_md_file()
944 if ((ret = mbedtls_md_starts(&ctx)) != 0) { in mbedtls_md_file()
949 if ((ret = mbedtls_md_update(&ctx, buf, n)) != 0) { in mbedtls_md_file()
954 if (ferror(f) != 0) { in mbedtls_md_file()
975 if (ctx == NULL || ctx->md_info == NULL || ctx->hmac_ctx == NULL) { in mbedtls_md_hmac_starts()
979 if (keylen > (size_t) ctx->md_info->block_size) { in mbedtls_md_hmac_starts()
980 if ((ret = mbedtls_md_starts(ctx)) != 0) { in mbedtls_md_hmac_starts()
983 if ((ret = mbedtls_md_update(ctx, key, keylen)) != 0) { in mbedtls_md_hmac_starts()
986 if ((ret = mbedtls_md_finish(ctx, sum)) != 0) { in mbedtls_md_hmac_starts()
1003 if ((ret = mbedtls_md_starts(ctx)) != 0) { in mbedtls_md_hmac_starts()
1006 if ((ret = mbedtls_md_update(ctx, ipad, in mbedtls_md_hmac_starts()
1019 if (ctx == NULL || ctx->md_info == NULL || ctx->hmac_ctx == NULL) { in mbedtls_md_hmac_update()
1032 if (ctx == NULL || ctx->md_info == NULL || ctx->hmac_ctx == NULL) { in mbedtls_md_hmac_finish()
1038 if ((ret = mbedtls_md_finish(ctx, tmp)) != 0) { in mbedtls_md_hmac_finish()
1041 if ((ret = mbedtls_md_starts(ctx)) != 0) { in mbedtls_md_hmac_finish()
1044 if ((ret = mbedtls_md_update(ctx, opad, in mbedtls_md_hmac_finish()
1048 if ((ret = mbedtls_md_update(ctx, tmp, in mbedtls_md_hmac_finish()
1060 if (ctx == NULL || ctx->md_info == NULL || ctx->hmac_ctx == NULL) { in mbedtls_md_hmac_reset()
1066 if ((ret = mbedtls_md_starts(ctx)) != 0) { in mbedtls_md_hmac_reset()
1080 if (md_info == NULL) { in mbedtls_md_hmac()
1086 if ((ret = mbedtls_md_setup(&ctx, md_info, 1)) != 0) { in mbedtls_md_hmac()
1090 if ((ret = mbedtls_md_hmac_starts(&ctx, key, keylen)) != 0) { in mbedtls_md_hmac()
1093 if ((ret = mbedtls_md_hmac_update(&ctx, input, ilen)) != 0) { in mbedtls_md_hmac()
1096 if ((ret = mbedtls_md_hmac_finish(&ctx, output)) != 0) { in mbedtls_md_hmac()