Lines Matching full:mac
21 EVP_MAC *mac = vmac; in evp_mac_up_ref() local
24 CRYPTO_UP_REF(&mac->refcnt, &ref, mac->lock); in evp_mac_up_ref()
30 EVP_MAC *mac = vmac; in evp_mac_free() local
33 if (mac == NULL) in evp_mac_free()
36 CRYPTO_DOWN_REF(&mac->refcnt, &ref, mac->lock); in evp_mac_free()
39 OPENSSL_free(mac->type_name); in evp_mac_free()
40 ossl_provider_free(mac->prov); in evp_mac_free()
41 CRYPTO_THREAD_lock_free(mac->lock); in evp_mac_free()
42 OPENSSL_free(mac); in evp_mac_free()
47 EVP_MAC *mac = NULL; in evp_mac_new() local
49 if ((mac = OPENSSL_zalloc(sizeof(*mac))) == NULL in evp_mac_new()
50 || (mac->lock = CRYPTO_THREAD_lock_new()) == NULL) { in evp_mac_new()
51 evp_mac_free(mac); in evp_mac_new()
55 mac->refcnt = 1; in evp_mac_new()
57 return mac; in evp_mac_new()
65 EVP_MAC *mac = NULL; in evp_mac_from_algorithm() local
68 if ((mac = evp_mac_new()) == NULL) { in evp_mac_from_algorithm()
72 mac->name_id = name_id; in evp_mac_from_algorithm()
73 if ((mac->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) { in evp_mac_from_algorithm()
74 evp_mac_free(mac); in evp_mac_from_algorithm()
77 mac->description = algodef->algorithm_description; in evp_mac_from_algorithm()
82 if (mac->newctx != NULL) in evp_mac_from_algorithm()
84 mac->newctx = OSSL_FUNC_mac_newctx(fns); in evp_mac_from_algorithm()
88 if (mac->dupctx != NULL) in evp_mac_from_algorithm()
90 mac->dupctx = OSSL_FUNC_mac_dupctx(fns); in evp_mac_from_algorithm()
93 if (mac->freectx != NULL) in evp_mac_from_algorithm()
95 mac->freectx = OSSL_FUNC_mac_freectx(fns); in evp_mac_from_algorithm()
99 if (mac->init != NULL) in evp_mac_from_algorithm()
101 mac->init = OSSL_FUNC_mac_init(fns); in evp_mac_from_algorithm()
105 if (mac->update != NULL) in evp_mac_from_algorithm()
107 mac->update = OSSL_FUNC_mac_update(fns); in evp_mac_from_algorithm()
111 if (mac->final != NULL) in evp_mac_from_algorithm()
113 mac->final = OSSL_FUNC_mac_final(fns); in evp_mac_from_algorithm()
117 if (mac->gettable_params != NULL) in evp_mac_from_algorithm()
119 mac->gettable_params = in evp_mac_from_algorithm()
123 if (mac->gettable_ctx_params != NULL) in evp_mac_from_algorithm()
125 mac->gettable_ctx_params = in evp_mac_from_algorithm()
129 if (mac->settable_ctx_params != NULL) in evp_mac_from_algorithm()
131 mac->settable_ctx_params = in evp_mac_from_algorithm()
135 if (mac->get_params != NULL) in evp_mac_from_algorithm()
137 mac->get_params = OSSL_FUNC_mac_get_params(fns); in evp_mac_from_algorithm()
140 if (mac->get_ctx_params != NULL) in evp_mac_from_algorithm()
142 mac->get_ctx_params = OSSL_FUNC_mac_get_ctx_params(fns); in evp_mac_from_algorithm()
145 if (mac->set_ctx_params != NULL) in evp_mac_from_algorithm()
147 mac->set_ctx_params = OSSL_FUNC_mac_set_ctx_params(fns); in evp_mac_from_algorithm()
155 * a complete set of "mac" functions, and a complete set of context in evp_mac_from_algorithm()
158 evp_mac_free(mac); in evp_mac_from_algorithm()
162 mac->prov = prov; in evp_mac_from_algorithm()
166 return mac; in evp_mac_from_algorithm()
177 int EVP_MAC_up_ref(EVP_MAC *mac) in EVP_MAC_up_ref() argument
179 return evp_mac_up_ref(mac); in EVP_MAC_up_ref()
182 void EVP_MAC_free(EVP_MAC *mac) in EVP_MAC_free() argument
184 evp_mac_free(mac); in EVP_MAC_free()
187 const OSSL_PROVIDER *EVP_MAC_get0_provider(const EVP_MAC *mac) in EVP_MAC_get0_provider() argument
189 return mac->prov; in EVP_MAC_get0_provider()
192 const OSSL_PARAM *EVP_MAC_gettable_params(const EVP_MAC *mac) in EVP_MAC_gettable_params() argument
194 if (mac->gettable_params == NULL) in EVP_MAC_gettable_params()
196 return mac->gettable_params(ossl_provider_ctx(EVP_MAC_get0_provider(mac))); in EVP_MAC_gettable_params()
199 const OSSL_PARAM *EVP_MAC_gettable_ctx_params(const EVP_MAC *mac) in EVP_MAC_gettable_ctx_params() argument
203 if (mac->gettable_ctx_params == NULL) in EVP_MAC_gettable_ctx_params()
205 alg = ossl_provider_ctx(EVP_MAC_get0_provider(mac)); in EVP_MAC_gettable_ctx_params()
206 return mac->gettable_ctx_params(NULL, alg); in EVP_MAC_gettable_ctx_params()
209 const OSSL_PARAM *EVP_MAC_settable_ctx_params(const EVP_MAC *mac) in EVP_MAC_settable_ctx_params() argument
213 if (mac->settable_ctx_params == NULL) in EVP_MAC_settable_ctx_params()
215 alg = ossl_provider_ctx(EVP_MAC_get0_provider(mac)); in EVP_MAC_settable_ctx_params()
216 return mac->settable_ctx_params(NULL, alg); in EVP_MAC_settable_ctx_params()
240 void (*fn)(EVP_MAC *mac, void *arg), in EVP_MAC_do_all_provided() argument