Lines Matching refs:alg
51 struct crypto_alg *q, *alg = NULL; in crypto_alg_match() local
73 alg = q; in crypto_alg_match()
79 return alg; in crypto_alg_match()
82 static int crypto_report_cipher(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_cipher() argument
88 rcipher.blocksize = alg->cra_blocksize; in crypto_report_cipher()
89 rcipher.min_keysize = alg->cra_cipher.cia_min_keysize; in crypto_report_cipher()
90 rcipher.max_keysize = alg->cra_cipher.cia_max_keysize; in crypto_report_cipher()
101 static int crypto_report_comp(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_comp() argument
115 static int crypto_report_acomp(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_acomp() argument
130 static int crypto_report_akcipher(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_akcipher() argument
145 static int crypto_report_kpp(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_kpp() argument
160 static int crypto_report_one(struct crypto_alg *alg, in crypto_report_one() argument
163 strlcpy(ualg->cru_name, alg->cra_name, sizeof(ualg->cru_name)); in crypto_report_one()
164 strlcpy(ualg->cru_driver_name, alg->cra_driver_name, in crypto_report_one()
166 strlcpy(ualg->cru_module_name, module_name(alg->cra_module), in crypto_report_one()
171 ualg->cru_flags = alg->cra_flags; in crypto_report_one()
172 ualg->cru_refcnt = refcount_read(&alg->cra_refcnt); in crypto_report_one()
174 if (nla_put_u32(skb, CRYPTOCFGA_PRIORITY_VAL, alg->cra_priority)) in crypto_report_one()
176 if (alg->cra_flags & CRYPTO_ALG_LARVAL) { in crypto_report_one()
186 if (alg->cra_type && alg->cra_type->report) { in crypto_report_one()
187 if (alg->cra_type->report(skb, alg)) in crypto_report_one()
193 switch (alg->cra_flags & (CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_LARVAL)) { in crypto_report_one()
195 if (crypto_report_cipher(skb, alg)) in crypto_report_one()
200 if (crypto_report_comp(skb, alg)) in crypto_report_one()
205 if (crypto_report_acomp(skb, alg)) in crypto_report_one()
210 if (crypto_report_akcipher(skb, alg)) in crypto_report_one()
215 if (crypto_report_kpp(skb, alg)) in crypto_report_one()
227 static int crypto_report_alg(struct crypto_alg *alg, in crypto_report_alg() argument
245 err = crypto_report_one(alg, ualg, skb); in crypto_report_alg()
261 struct crypto_alg *alg; in crypto_report() local
269 alg = crypto_alg_match(p, 0); in crypto_report()
270 if (!alg) in crypto_report()
283 err = crypto_report_alg(alg, &info); in crypto_report()
286 crypto_mod_put(alg); in crypto_report()
296 struct crypto_alg *alg; in crypto_dump_report() local
310 list_for_each_entry(alg, &crypto_alg_list, cra_list) { in crypto_dump_report()
311 err = crypto_report_alg(alg, &info); in crypto_dump_report()
330 struct crypto_alg *alg; in crypto_update_alg() local
344 alg = crypto_alg_match(p, 1); in crypto_update_alg()
345 if (!alg) in crypto_update_alg()
350 crypto_remove_spawns(alg, &list, NULL); in crypto_update_alg()
353 alg->cra_priority = nla_get_u32(priority); in crypto_update_alg()
357 crypto_mod_put(alg); in crypto_update_alg()
366 struct crypto_alg *alg; in crypto_del_alg() local
376 alg = crypto_alg_match(p, 1); in crypto_del_alg()
377 if (!alg) in crypto_del_alg()
386 if (!(alg->cra_flags & CRYPTO_ALG_INSTANCE)) in crypto_del_alg()
390 if (refcount_read(&alg->cra_refcnt) > 2) in crypto_del_alg()
393 err = crypto_unregister_instance((struct crypto_instance *)alg); in crypto_del_alg()
396 crypto_mod_put(alg); in crypto_del_alg()
405 struct crypto_alg *alg; in crypto_add_alg() local
421 alg = crypto_alg_match(p, exact); in crypto_add_alg()
422 if (alg) { in crypto_add_alg()
423 crypto_mod_put(alg); in crypto_add_alg()
432 alg = crypto_alg_mod_lookup(name, p->cru_type, p->cru_mask); in crypto_add_alg()
433 if (IS_ERR(alg)) in crypto_add_alg()
434 return PTR_ERR(alg); in crypto_add_alg()
439 alg->cra_priority = nla_get_u32(priority); in crypto_add_alg()
443 crypto_mod_put(alg); in crypto_add_alg()
502 struct crypto_alg *alg; in crypto_user_rcv_msg() local
509 list_for_each_entry(alg, &crypto_alg_list, cra_list) in crypto_user_rcv_msg()