Lines Matching refs:alg

38 	struct crypto_alg *q, *alg = NULL;  in crypto_alg_match()  local
63 alg = q; in crypto_alg_match()
69 return alg; in crypto_alg_match()
72 static int crypto_report_cipher(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_cipher() argument
80 rcipher.blocksize = alg->cra_blocksize; in crypto_report_cipher()
81 rcipher.min_keysize = alg->cra_cipher.cia_min_keysize; in crypto_report_cipher()
82 rcipher.max_keysize = alg->cra_cipher.cia_max_keysize; in crypto_report_cipher()
88 static int crypto_report_comp(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_comp() argument
99 static int crypto_report_one(struct crypto_alg *alg, in crypto_report_one() argument
104 strscpy(ualg->cru_name, alg->cra_name, sizeof(ualg->cru_name)); in crypto_report_one()
105 strscpy(ualg->cru_driver_name, alg->cra_driver_name, in crypto_report_one()
107 strscpy(ualg->cru_module_name, module_name(alg->cra_module), in crypto_report_one()
112 ualg->cru_flags = alg->cra_flags; in crypto_report_one()
113 ualg->cru_refcnt = refcount_read(&alg->cra_refcnt); in crypto_report_one()
115 if (nla_put_u32(skb, CRYPTOCFGA_PRIORITY_VAL, alg->cra_priority)) in crypto_report_one()
117 if (alg->cra_flags & CRYPTO_ALG_LARVAL) { in crypto_report_one()
127 if (alg->cra_type && alg->cra_type->report) { in crypto_report_one()
128 if (alg->cra_type->report(skb, alg)) in crypto_report_one()
134 switch (alg->cra_flags & (CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_LARVAL)) { in crypto_report_one()
136 if (crypto_report_cipher(skb, alg)) in crypto_report_one()
141 if (crypto_report_comp(skb, alg)) in crypto_report_one()
154 static int crypto_report_alg(struct crypto_alg *alg, in crypto_report_alg() argument
172 err = crypto_report_one(alg, ualg, skb); in crypto_report_alg()
189 struct crypto_alg *alg; in crypto_report() local
197 alg = crypto_alg_match(p, 0); in crypto_report()
198 if (!alg) in crypto_report()
211 err = crypto_report_alg(alg, &info); in crypto_report()
214 crypto_mod_put(alg); in crypto_report()
229 struct crypto_alg *alg; in crypto_dump_report() local
238 list_for_each_entry(alg, &crypto_alg_list, cra_list) { in crypto_dump_report()
240 res = crypto_report_alg(alg, &info); in crypto_dump_report()
263 struct crypto_alg *alg; in crypto_update_alg() local
277 alg = crypto_alg_match(p, 1); in crypto_update_alg()
278 if (!alg) in crypto_update_alg()
283 crypto_remove_spawns(alg, &list, NULL); in crypto_update_alg()
286 alg->cra_priority = nla_get_u32(priority); in crypto_update_alg()
290 crypto_mod_put(alg); in crypto_update_alg()
299 struct crypto_alg *alg; in crypto_del_alg() local
309 alg = crypto_alg_match(p, 1); in crypto_del_alg()
310 if (!alg) in crypto_del_alg()
319 if (!(alg->cra_flags & CRYPTO_ALG_INSTANCE)) in crypto_del_alg()
323 if (refcount_read(&alg->cra_refcnt) > 2) in crypto_del_alg()
326 crypto_unregister_instance((struct crypto_instance *)alg); in crypto_del_alg()
330 crypto_mod_put(alg); in crypto_del_alg()
339 struct crypto_alg *alg; in crypto_add_alg() local
355 alg = crypto_alg_match(p, exact); in crypto_add_alg()
356 if (alg) { in crypto_add_alg()
357 crypto_mod_put(alg); in crypto_add_alg()
366 alg = crypto_alg_mod_lookup(name, p->cru_type, p->cru_mask); in crypto_add_alg()
367 if (IS_ERR(alg)) in crypto_add_alg()
368 return PTR_ERR(alg); in crypto_add_alg()
373 alg->cra_priority = nla_get_u32(priority); in crypto_add_alg()
377 crypto_mod_put(alg); in crypto_add_alg()
439 struct crypto_alg *alg; in crypto_user_rcv_msg() local
446 list_for_each_entry(alg, &crypto_alg_list, cra_list) in crypto_user_rcv_msg()