Lines Matching refs:md_ctx
241 if (ctx->md_ctx != NULL) { in mbedtls_md_free()
244 psa_hash_abort(ctx->md_ctx); in mbedtls_md_free()
250 mbedtls_md5_free(ctx->md_ctx); in mbedtls_md_free()
255 mbedtls_ripemd160_free(ctx->md_ctx); in mbedtls_md_free()
260 mbedtls_sha1_free(ctx->md_ctx); in mbedtls_md_free()
265 mbedtls_sha256_free(ctx->md_ctx); in mbedtls_md_free()
270 mbedtls_sha256_free(ctx->md_ctx); in mbedtls_md_free()
275 mbedtls_sha512_free(ctx->md_ctx); in mbedtls_md_free()
280 mbedtls_sha512_free(ctx->md_ctx); in mbedtls_md_free()
287 mbedtls_free(ctx->md_ctx); in mbedtls_md_free()
320 psa_status_t status = psa_hash_clone(src->md_ctx, dst->md_ctx); in mbedtls_md_clone()
328 mbedtls_md5_clone(dst->md_ctx, src->md_ctx); in mbedtls_md_clone()
333 mbedtls_ripemd160_clone(dst->md_ctx, src->md_ctx); in mbedtls_md_clone()
338 mbedtls_sha1_clone(dst->md_ctx, src->md_ctx); in mbedtls_md_clone()
343 mbedtls_sha256_clone(dst->md_ctx, src->md_ctx); in mbedtls_md_clone()
348 mbedtls_sha256_clone(dst->md_ctx, src->md_ctx); in mbedtls_md_clone()
353 mbedtls_sha512_clone(dst->md_ctx, src->md_ctx); in mbedtls_md_clone()
358 mbedtls_sha512_clone(dst->md_ctx, src->md_ctx); in mbedtls_md_clone()
370 ctx->md_ctx = mbedtls_calloc(1, sizeof(mbedtls_##type##_context)); \
371 if (ctx->md_ctx == NULL) \
373 mbedtls_##type##_init(ctx->md_ctx); \
384 ctx->md_ctx = NULL; in mbedtls_md_setup()
395 ctx->md_ctx = mbedtls_calloc(1, sizeof(psa_hash_operation_t)); in mbedtls_md_setup()
396 if (ctx->md_ctx == NULL) { in mbedtls_md_setup()
465 psa_hash_abort(ctx->md_ctx); in mbedtls_md_starts()
466 psa_status_t status = psa_hash_setup(ctx->md_ctx, alg); in mbedtls_md_starts()
474 return mbedtls_md5_starts(ctx->md_ctx); in mbedtls_md_starts()
478 return mbedtls_ripemd160_starts(ctx->md_ctx); in mbedtls_md_starts()
482 return mbedtls_sha1_starts(ctx->md_ctx); in mbedtls_md_starts()
486 return mbedtls_sha256_starts(ctx->md_ctx, 1); in mbedtls_md_starts()
490 return mbedtls_sha256_starts(ctx->md_ctx, 0); in mbedtls_md_starts()
494 return mbedtls_sha512_starts(ctx->md_ctx, 1); in mbedtls_md_starts()
498 return mbedtls_sha512_starts(ctx->md_ctx, 0); in mbedtls_md_starts()
513 psa_status_t status = psa_hash_update(ctx->md_ctx, input, ilen); in mbedtls_md_update()
521 return mbedtls_md5_update(ctx->md_ctx, input, ilen); in mbedtls_md_update()
525 return mbedtls_ripemd160_update(ctx->md_ctx, input, ilen); in mbedtls_md_update()
529 return mbedtls_sha1_update(ctx->md_ctx, input, ilen); in mbedtls_md_update()
533 return mbedtls_sha256_update(ctx->md_ctx, input, ilen); in mbedtls_md_update()
537 return mbedtls_sha256_update(ctx->md_ctx, input, ilen); in mbedtls_md_update()
541 return mbedtls_sha512_update(ctx->md_ctx, input, ilen); in mbedtls_md_update()
545 return mbedtls_sha512_update(ctx->md_ctx, input, ilen); in mbedtls_md_update()
561 psa_status_t status = psa_hash_finish(ctx->md_ctx, in mbedtls_md_finish()
570 return mbedtls_md5_finish(ctx->md_ctx, output); in mbedtls_md_finish()
574 return mbedtls_ripemd160_finish(ctx->md_ctx, output); in mbedtls_md_finish()
578 return mbedtls_sha1_finish(ctx->md_ctx, output); in mbedtls_md_finish()
582 return mbedtls_sha256_finish(ctx->md_ctx, output); in mbedtls_md_finish()
586 return mbedtls_sha256_finish(ctx->md_ctx, output); in mbedtls_md_finish()
590 return mbedtls_sha512_finish(ctx->md_ctx, output); in mbedtls_md_finish()
594 return mbedtls_sha512_finish(ctx->md_ctx, output); in mbedtls_md_finish()