Lines Matching refs:alg

37 	struct crypto_alg *q, *alg = NULL;  in crypto_alg_match()  local
62 alg = q; in crypto_alg_match()
68 return alg; in crypto_alg_match()
71 static int crypto_report_cipher(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_cipher() argument
79 rcipher.blocksize = alg->cra_blocksize; in crypto_report_cipher()
80 rcipher.min_keysize = alg->cra_cipher.cia_min_keysize; in crypto_report_cipher()
81 rcipher.max_keysize = alg->cra_cipher.cia_max_keysize; in crypto_report_cipher()
87 static int crypto_report_comp(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_comp() argument
98 static int crypto_report_one(struct crypto_alg *alg, in crypto_report_one() argument
103 strscpy(ualg->cru_name, alg->cra_name, sizeof(ualg->cru_name)); in crypto_report_one()
104 strscpy(ualg->cru_driver_name, alg->cra_driver_name, in crypto_report_one()
106 strscpy(ualg->cru_module_name, module_name(alg->cra_module), in crypto_report_one()
111 ualg->cru_flags = alg->cra_flags; in crypto_report_one()
112 ualg->cru_refcnt = refcount_read(&alg->cra_refcnt); in crypto_report_one()
114 if (nla_put_u32(skb, CRYPTOCFGA_PRIORITY_VAL, alg->cra_priority)) in crypto_report_one()
116 if (alg->cra_flags & CRYPTO_ALG_LARVAL) { in crypto_report_one()
126 if (alg->cra_type && alg->cra_type->report) { in crypto_report_one()
127 if (alg->cra_type->report(skb, alg)) in crypto_report_one()
133 switch (alg->cra_flags & (CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_LARVAL)) { in crypto_report_one()
135 if (crypto_report_cipher(skb, alg)) in crypto_report_one()
140 if (crypto_report_comp(skb, alg)) in crypto_report_one()
153 static int crypto_report_alg(struct crypto_alg *alg, in crypto_report_alg() argument
171 err = crypto_report_one(alg, ualg, skb); in crypto_report_alg()
188 struct crypto_alg *alg; in crypto_report() local
196 alg = crypto_alg_match(p, 0); in crypto_report()
197 if (!alg) in crypto_report()
210 err = crypto_report_alg(alg, &info); in crypto_report()
213 crypto_mod_put(alg); in crypto_report()
228 struct crypto_alg *alg; in crypto_dump_report() local
237 list_for_each_entry(alg, &crypto_alg_list, cra_list) { in crypto_dump_report()
239 res = crypto_report_alg(alg, &info); in crypto_dump_report()
262 struct crypto_alg *alg; in crypto_update_alg() local
276 alg = crypto_alg_match(p, 1); in crypto_update_alg()
277 if (!alg) in crypto_update_alg()
282 crypto_remove_spawns(alg, &list, NULL); in crypto_update_alg()
285 alg->cra_priority = nla_get_u32(priority); in crypto_update_alg()
289 crypto_mod_put(alg); in crypto_update_alg()
298 struct crypto_alg *alg; in crypto_del_alg() local
308 alg = crypto_alg_match(p, 1); in crypto_del_alg()
309 if (!alg) in crypto_del_alg()
318 if (!(alg->cra_flags & CRYPTO_ALG_INSTANCE)) in crypto_del_alg()
322 if (refcount_read(&alg->cra_refcnt) > 2) in crypto_del_alg()
325 crypto_unregister_instance((struct crypto_instance *)alg); in crypto_del_alg()
329 crypto_mod_put(alg); in crypto_del_alg()
338 struct crypto_alg *alg; in crypto_add_alg() local
354 alg = crypto_alg_match(p, exact); in crypto_add_alg()
355 if (alg) { in crypto_add_alg()
356 crypto_mod_put(alg); in crypto_add_alg()
365 alg = crypto_alg_mod_lookup(name, p->cru_type, p->cru_mask); in crypto_add_alg()
366 if (IS_ERR(alg)) in crypto_add_alg()
367 return PTR_ERR(alg); in crypto_add_alg()
372 alg->cra_priority = nla_get_u32(priority); in crypto_add_alg()
376 crypto_mod_put(alg); in crypto_add_alg()
445 struct crypto_alg *alg; in crypto_user_rcv_msg() local
452 list_for_each_entry(alg, &crypto_alg_list, cra_list) in crypto_user_rcv_msg()