Lines Matching defs:alg
30 static inline int crypto_alg_get(struct crypto_alg *alg)
32 return try_inc_mod_count(alg->cra_module);
35 static inline void crypto_alg_put(struct crypto_alg *alg)
37 if (alg->cra_module)
38 __MOD_DEC_USE_COUNT(alg->cra_module);
43 struct crypto_alg *q, *alg = NULL;
53 alg = q;
59 return alg;
128 struct crypto_alg *alg;
130 alg = crypto_alg_mod_lookup(name);
131 if (alg == NULL)
134 tfm = kzalloc(sizeof(*tfm) + alg->cra_ctxsize, GFP_KERNEL);
138 tfm->__crt_alg = alg;
154 crypto_alg_put(alg);
161 struct crypto_alg *alg = tfm->__crt_alg;
162 int size = sizeof(*tfm) + alg->cra_ctxsize;
165 crypto_alg_put(alg);
170 int crypto_register_alg(struct crypto_alg *alg)
178 if (!(strcmp(q->cra_name, alg->cra_name))) {
184 list_add_tail(&alg->cra_list, &crypto_alg_list);
190 int crypto_unregister_alg(struct crypto_alg *alg)
195 BUG_ON(!alg->cra_module);
199 if (alg == q) {
200 list_del(&alg->cra_list);
213 struct crypto_alg *alg = crypto_alg_mod_lookup(name);
215 if (alg) {
216 crypto_alg_put(alg);