Lines Matching refs:md

736 int EVP_MD_is_a(const EVP_MD *md, const char *name)  in EVP_MD_is_a()  argument
738 if (md == NULL) in EVP_MD_is_a()
740 if (md->prov != NULL) in EVP_MD_is_a()
741 return evp_is_a(md->prov, md->name_id, NULL, name); in EVP_MD_is_a()
742 return evp_is_a(NULL, 0, EVP_MD_get0_name(md), name); in EVP_MD_is_a()
745 int evp_md_get_number(const EVP_MD *md) in evp_md_get_number() argument
747 return md->name_id; in evp_md_get_number()
750 const char *EVP_MD_get0_description(const EVP_MD *md) in EVP_MD_get0_description() argument
752 if (md->description != NULL) in EVP_MD_get0_description()
753 return md->description; in EVP_MD_get0_description()
755 return OBJ_nid2ln(EVP_MD_nid(md)); in EVP_MD_get0_description()
761 const char *EVP_MD_get0_name(const EVP_MD *md) in EVP_MD_get0_name() argument
763 if (md == NULL) in EVP_MD_get0_name()
765 if (md->type_name != NULL) in EVP_MD_get0_name()
766 return md->type_name; in EVP_MD_get0_name()
768 return OBJ_nid2sn(EVP_MD_nid(md)); in EVP_MD_get0_name()
774 int EVP_MD_names_do_all(const EVP_MD *md, in EVP_MD_names_do_all() argument
778 if (md->prov != NULL) in EVP_MD_names_do_all()
779 return evp_names_do_all(md->prov, md->name_id, fn, data); in EVP_MD_names_do_all()
784 const OSSL_PROVIDER *EVP_MD_get0_provider(const EVP_MD *md) in EVP_MD_get0_provider() argument
786 return md->prov; in EVP_MD_get0_provider()
789 int EVP_MD_get_type(const EVP_MD *md) in EVP_MD_get_type() argument
791 return md->type; in EVP_MD_get_type()
794 int EVP_MD_get_pkey_type(const EVP_MD *md) in EVP_MD_get_pkey_type() argument
796 return md->pkey_type; in EVP_MD_get_pkey_type()
799 int EVP_MD_get_block_size(const EVP_MD *md) in EVP_MD_get_block_size() argument
801 if (md == NULL) { in EVP_MD_get_block_size()
805 return md->block_size; in EVP_MD_get_block_size()
808 int EVP_MD_get_size(const EVP_MD *md) in EVP_MD_get_size() argument
810 if (md == NULL) { in EVP_MD_get_size()
814 return md->md_size; in EVP_MD_get_size()
817 int EVP_MD_xof(const EVP_MD *md) in EVP_MD_xof() argument
819 return md != NULL && ((EVP_MD_get_flags(md) & EVP_MD_FLAG_XOF) != 0); in EVP_MD_xof()
822 unsigned long EVP_MD_get_flags(const EVP_MD *md) in EVP_MD_get_flags() argument
824 return md->flags; in EVP_MD_get_flags()
829 EVP_MD *md = evp_md_new(); in EVP_MD_meth_new() local
831 if (md != NULL) { in EVP_MD_meth_new()
832 md->type = md_type; in EVP_MD_meth_new()
833 md->pkey_type = pkey_type; in EVP_MD_meth_new()
834 md->origin = EVP_ORIG_METH; in EVP_MD_meth_new()
836 return md; in EVP_MD_meth_new()
839 EVP_MD *EVP_MD_meth_dup(const EVP_MD *md) in EVP_MD_meth_dup() argument
847 if (md->prov != NULL) in EVP_MD_meth_dup()
850 if ((to = EVP_MD_meth_new(md->type, md->pkey_type)) != NULL) { in EVP_MD_meth_dup()
853 memcpy(to, md, sizeof(*to)); in EVP_MD_meth_dup()
860 void evp_md_free_int(EVP_MD *md) in evp_md_free_int() argument
862 OPENSSL_free(md->type_name); in evp_md_free_int()
863 ossl_provider_free(md->prov); in evp_md_free_int()
864 CRYPTO_FREE_REF(&md->refcnt); in evp_md_free_int()
865 OPENSSL_free(md); in evp_md_free_int()
868 void EVP_MD_meth_free(EVP_MD *md) in EVP_MD_meth_free() argument
870 if (md == NULL || md->origin != EVP_ORIG_METH) in EVP_MD_meth_free()
873 evp_md_free_int(md); in EVP_MD_meth_free()
876 int EVP_MD_meth_set_input_blocksize(EVP_MD *md, int blocksize) in EVP_MD_meth_set_input_blocksize() argument
878 if (md->block_size != 0) in EVP_MD_meth_set_input_blocksize()
881 md->block_size = blocksize; in EVP_MD_meth_set_input_blocksize()
884 int EVP_MD_meth_set_result_size(EVP_MD *md, int resultsize) in EVP_MD_meth_set_result_size() argument
886 if (md->md_size != 0) in EVP_MD_meth_set_result_size()
889 md->md_size = resultsize; in EVP_MD_meth_set_result_size()
892 int EVP_MD_meth_set_app_datasize(EVP_MD *md, int datasize) in EVP_MD_meth_set_app_datasize() argument
894 if (md->ctx_size != 0) in EVP_MD_meth_set_app_datasize()
897 md->ctx_size = datasize; in EVP_MD_meth_set_app_datasize()
900 int EVP_MD_meth_set_flags(EVP_MD *md, unsigned long flags) in EVP_MD_meth_set_flags() argument
902 if (md->flags != 0) in EVP_MD_meth_set_flags()
905 md->flags = flags; in EVP_MD_meth_set_flags()
908 int EVP_MD_meth_set_init(EVP_MD *md, int (*init)(EVP_MD_CTX *ctx)) in EVP_MD_meth_set_init() argument
910 if (md->init != NULL) in EVP_MD_meth_set_init()
913 md->init = init; in EVP_MD_meth_set_init()
916 int EVP_MD_meth_set_update(EVP_MD *md, int (*update)(EVP_MD_CTX *ctx, in EVP_MD_meth_set_update() argument
920 if (md->update != NULL) in EVP_MD_meth_set_update()
923 md->update = update; in EVP_MD_meth_set_update()
926 int EVP_MD_meth_set_final(EVP_MD *md, int (*final)(EVP_MD_CTX *ctx, in EVP_MD_meth_set_final() argument
927 unsigned char *md)) in EVP_MD_meth_set_final() argument
929 if (md->final != NULL) in EVP_MD_meth_set_final()
932 md->final = final; in EVP_MD_meth_set_final()
935 int EVP_MD_meth_set_copy(EVP_MD *md, int (*copy)(EVP_MD_CTX *to, in EVP_MD_meth_set_copy() argument
938 if (md->copy != NULL) in EVP_MD_meth_set_copy()
941 md->copy = copy; in EVP_MD_meth_set_copy()
944 int EVP_MD_meth_set_cleanup(EVP_MD *md, int (*cleanup)(EVP_MD_CTX *ctx)) in EVP_MD_meth_set_cleanup() argument
946 if (md->cleanup != NULL) in EVP_MD_meth_set_cleanup()
949 md->cleanup = cleanup; in EVP_MD_meth_set_cleanup()
952 int EVP_MD_meth_set_ctrl(EVP_MD *md, int (*ctrl)(EVP_MD_CTX *ctx, int cmd, in EVP_MD_meth_set_ctrl() argument
955 if (md->md_ctrl != NULL) in EVP_MD_meth_set_ctrl()
958 md->md_ctrl = ctrl; in EVP_MD_meth_set_ctrl()
962 int EVP_MD_meth_get_input_blocksize(const EVP_MD *md) in EVP_MD_meth_get_input_blocksize() argument
964 return md->block_size; in EVP_MD_meth_get_input_blocksize()
966 int EVP_MD_meth_get_result_size(const EVP_MD *md) in EVP_MD_meth_get_result_size() argument
968 return md->md_size; in EVP_MD_meth_get_result_size()
970 int EVP_MD_meth_get_app_datasize(const EVP_MD *md) in EVP_MD_meth_get_app_datasize() argument
972 return md->ctx_size; in EVP_MD_meth_get_app_datasize()
974 unsigned long EVP_MD_meth_get_flags(const EVP_MD *md) in EVP_MD_meth_get_flags() argument
976 return md->flags; in EVP_MD_meth_get_flags()
978 int (*EVP_MD_meth_get_init(const EVP_MD *md))(EVP_MD_CTX *ctx) in EVP_MD_meth_get_init() argument
980 return md->init; in EVP_MD_meth_get_init()
982 int (*EVP_MD_meth_get_update(const EVP_MD *md))(EVP_MD_CTX *ctx, in EVP_MD_meth_get_update() argument
986 return md->update; in EVP_MD_meth_get_update()
988 int (*EVP_MD_meth_get_final(const EVP_MD *md))(EVP_MD_CTX *ctx, in EVP_MD_meth_get_final() argument
989 unsigned char *md) in EVP_MD_meth_get_final()
991 return md->final; in EVP_MD_meth_get_final()
993 int (*EVP_MD_meth_get_copy(const EVP_MD *md))(EVP_MD_CTX *to, in EVP_MD_meth_get_copy() argument
996 return md->copy; in EVP_MD_meth_get_copy()
998 int (*EVP_MD_meth_get_cleanup(const EVP_MD *md))(EVP_MD_CTX *ctx) in EVP_MD_meth_get_cleanup() argument
1000 return md->cleanup; in EVP_MD_meth_get_cleanup()
1002 int (*EVP_MD_meth_get_ctrl(const EVP_MD *md))(EVP_MD_CTX *ctx, int cmd, in EVP_MD_meth_get_ctrl() argument
1005 return md->md_ctrl; in EVP_MD_meth_get_ctrl()
1026 EVP_MD *md; in EVP_MD_CTX_get1_md() local
1030 md = (EVP_MD *)ctx->reqdigest; in EVP_MD_CTX_get1_md()
1031 if (md == NULL || !EVP_MD_up_ref(md)) in EVP_MD_CTX_get1_md()
1033 return md; in EVP_MD_CTX_get1_md()