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