Lines Matching refs:digest

31     if (ctx->digest != NULL) {  in cleanup_old_md_data()
32 if (ctx->digest->cleanup != NULL in cleanup_old_md_data()
34 ctx->digest->cleanup(ctx); in cleanup_old_md_data()
35 if (ctx->md_data != NULL && ctx->digest->ctx_size > 0 in cleanup_old_md_data()
38 OPENSSL_clear_free(ctx->md_data, ctx->digest->ctx_size); in cleanup_old_md_data()
47 if (ctx->digest != NULL && ctx->digest->freectx != NULL) in evp_md_ctx_clear_digest()
48 ctx->digest->freectx(ctx->algctx); in evp_md_ctx_clear_digest()
61 ctx->digest = NULL; in evp_md_ctx_clear_digest()
146 if (!ossl_assert(ctx->digest != NULL)) { in evp_md_ctx_free_algctx()
150 if (ctx->digest->freectx != NULL) in evp_md_ctx_free_algctx()
151 ctx->digest->freectx(ctx->algctx); in evp_md_ctx_free_algctx()
189 if (ctx->digest == NULL) { in evp_md_init_internal()
193 type = ctx->digest; in evp_md_init_internal()
205 && ctx->digest != NULL in evp_md_init_internal()
206 && type->type == ctx->digest->type) in evp_md_init_internal()
234 || (type == NULL && ctx->digest != NULL in evp_md_init_internal()
235 && ctx->digest->origin == EVP_ORIG_METH)) { in evp_md_init_internal()
239 if (ctx->digest == ctx->fetched_digest) in evp_md_init_internal()
240 ctx->digest = NULL; in evp_md_init_internal()
249 if (ctx->digest == type) { in evp_md_init_internal()
288 ctx->digest = type; in evp_md_init_internal()
290 ctx->algctx = ctx->digest->newctx(ossl_provider_ctx(type->prov)); in evp_md_init_internal()
297 if (ctx->digest->dinit == NULL) { in evp_md_init_internal()
302 return ctx->digest->dinit(ctx->algctx, params); in evp_md_init_internal()
338 if (ctx->digest != type) { in evp_md_init_internal()
341 ctx->digest = type; in evp_md_init_internal()
365 return ctx->digest->init(ctx); in evp_md_init_internal()
416 if (ctx->digest == NULL in EVP_DigestUpdate()
417 || ctx->digest->prov == NULL in EVP_DigestUpdate()
421 if (ctx->digest->dupdate == NULL) { in EVP_DigestUpdate()
425 return ctx->digest->dupdate(ctx->algctx, data, count); in EVP_DigestUpdate()
448 if (ctx->digest == NULL) in EVP_DigestFinal_ex()
455 if (ctx->digest->prov == NULL) in EVP_DigestFinal_ex()
458 if (ctx->digest->dfinal == NULL) { in EVP_DigestFinal_ex()
468 ret = ctx->digest->dfinal(ctx->algctx, md, &size, mdsize); in EVP_DigestFinal_ex()
486 ret = ctx->digest->final(ctx, md); in EVP_DigestFinal_ex()
489 if (ctx->digest->cleanup) { in EVP_DigestFinal_ex()
490 ctx->digest->cleanup(ctx); in EVP_DigestFinal_ex()
493 OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size); in EVP_DigestFinal_ex()
504 if (ctx->digest == NULL) { in EVP_DigestFinalXOF()
509 if (ctx->digest->prov == NULL) in EVP_DigestFinalXOF()
512 if (ctx->digest->dfinal == NULL) { in EVP_DigestFinalXOF()
531 ret = ctx->digest->dfinal(ctx->algctx, md, &size, size); in EVP_DigestFinalXOF()
538 if (EVP_MD_xof(ctx->digest) in EVP_DigestFinalXOF()
540 && ctx->digest->md_ctrl(ctx, EVP_MD_CTRL_XOF_LEN, (int)size, NULL)) { in EVP_DigestFinalXOF()
541 ret = ctx->digest->final(ctx, md); in EVP_DigestFinalXOF()
542 if (ctx->digest->cleanup != NULL) { in EVP_DigestFinalXOF()
543 ctx->digest->cleanup(ctx); in EVP_DigestFinalXOF()
546 OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size); in EVP_DigestFinalXOF()
557 if (ctx->digest == NULL) { in EVP_DigestSqueeze()
562 if (ctx->digest->prov == NULL) { in EVP_DigestSqueeze()
567 if (ctx->digest->dsqueeze == NULL) { in EVP_DigestSqueeze()
572 return ctx->digest->dsqueeze(ctx->algctx, md, &size, size); in EVP_DigestSqueeze()
602 if (in->digest == NULL) { in EVP_MD_CTX_copy_ex()
611 if (in->digest->prov == NULL in EVP_MD_CTX_copy_ex()
615 if (in->digest->dupctx == NULL) { in EVP_MD_CTX_copy_ex()
620 if (out->digest == in->digest && in->digest->copyctx != NULL) { in EVP_MD_CTX_copy_ex()
622 in->digest->copyctx(out->algctx, in->algctx); in EVP_MD_CTX_copy_ex()
644 out->algctx = in->digest->dupctx(in->algctx); in EVP_MD_CTX_copy_ex()
678 if (out->digest == in->digest) { in EVP_MD_CTX_copy_ex()
696 if (in->md_data && out->digest->ctx_size) { in EVP_MD_CTX_copy_ex()
700 out->md_data = OPENSSL_malloc(out->digest->ctx_size); in EVP_MD_CTX_copy_ex()
704 memcpy(out->md_data, in->md_data, out->digest->ctx_size); in EVP_MD_CTX_copy_ex()
719 if (out->digest->copy) in EVP_MD_CTX_copy_ex()
720 return out->digest->copy(out, in); in EVP_MD_CTX_copy_ex()
747 EVP_MD *digest = EVP_MD_fetch(libctx, name, propq); in EVP_Q_digest() local
751 if (digest != NULL) { in EVP_Q_digest()
752 ret = EVP_Digest(data, datalen, md, &temp, digest, NULL); in EVP_Q_digest()
753 EVP_MD_free(digest); in EVP_Q_digest()
760 int EVP_MD_get_params(const EVP_MD *digest, OSSL_PARAM params[]) in EVP_MD_get_params() argument
762 if (digest != NULL && digest->get_params != NULL) in EVP_MD_get_params()
763 return digest->get_params(params); in EVP_MD_get_params()
767 const OSSL_PARAM *EVP_MD_gettable_params(const EVP_MD *digest) in EVP_MD_gettable_params() argument
769 if (digest != NULL && digest->gettable_params != NULL) in EVP_MD_gettable_params()
770 return digest->gettable_params( in EVP_MD_gettable_params()
771 ossl_provider_ctx(EVP_MD_get0_provider(digest))); in EVP_MD_gettable_params()
788 if (ctx->digest != NULL && ctx->digest->set_ctx_params != NULL) in EVP_MD_CTX_set_params()
789 return ctx->digest->set_ctx_params(ctx->algctx, params); in EVP_MD_CTX_set_params()
823 if (ctx->digest != NULL && ctx->digest->settable_ctx_params != NULL) { in EVP_MD_CTX_settable_params()
824 alg = ossl_provider_ctx(EVP_MD_get0_provider(ctx->digest)); in EVP_MD_CTX_settable_params()
825 return ctx->digest->settable_ctx_params(ctx->algctx, alg); in EVP_MD_CTX_settable_params()
844 if (ctx->digest != NULL && ctx->digest->get_ctx_params != NULL) in EVP_MD_CTX_get_params()
845 return ctx->digest->get_ctx_params(ctx->algctx, params); in EVP_MD_CTX_get_params()
879 if (ctx->digest != NULL && ctx->digest->gettable_ctx_params != NULL) { in EVP_MD_CTX_gettable_params()
880 provctx = ossl_provider_ctx(EVP_MD_get0_provider(ctx->digest)); in EVP_MD_CTX_gettable_params()
881 return ctx->digest->gettable_ctx_params(ctx->algctx, provctx); in EVP_MD_CTX_gettable_params()
898 if (ctx->digest != NULL && ctx->digest->prov == NULL) in EVP_MD_CTX_ctrl()
928 if (ctx->digest->md_ctrl == NULL) { in EVP_MD_CTX_ctrl()
933 ret = ctx->digest->md_ctrl(ctx, cmd, p1, p2); in EVP_MD_CTX_ctrl()
1078 if (md->digest == NULL) in evp_md_from_algorithm()
1079 md->digest = OSSL_FUNC_digest_digest(fns); in evp_md_from_algorithm()
1126 || (fncnt == 0 && md->digest == NULL)) { in evp_md_from_algorithm()