Lines Matching refs:alg
50 struct crypto_alg *q, *alg = NULL; in crypto_alg_match() local
72 alg = q; in crypto_alg_match()
78 return alg; in crypto_alg_match()
81 static int crypto_report_cipher(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_cipher() argument
87 rcipher.blocksize = alg->cra_blocksize; in crypto_report_cipher()
88 rcipher.min_keysize = alg->cra_cipher.cia_min_keysize; in crypto_report_cipher()
89 rcipher.max_keysize = alg->cra_cipher.cia_max_keysize; in crypto_report_cipher()
100 static int crypto_report_comp(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_comp() argument
114 static int crypto_report_akcipher(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_akcipher() argument
129 static int crypto_report_one(struct crypto_alg *alg, in crypto_report_one() argument
132 strncpy(ualg->cru_name, alg->cra_name, sizeof(ualg->cru_name)); in crypto_report_one()
133 strncpy(ualg->cru_driver_name, alg->cra_driver_name, in crypto_report_one()
135 strncpy(ualg->cru_module_name, module_name(alg->cra_module), in crypto_report_one()
140 ualg->cru_flags = alg->cra_flags; in crypto_report_one()
141 ualg->cru_refcnt = atomic_read(&alg->cra_refcnt); in crypto_report_one()
143 if (nla_put_u32(skb, CRYPTOCFGA_PRIORITY_VAL, alg->cra_priority)) in crypto_report_one()
145 if (alg->cra_flags & CRYPTO_ALG_LARVAL) { in crypto_report_one()
155 if (alg->cra_type && alg->cra_type->report) { in crypto_report_one()
156 if (alg->cra_type->report(skb, alg)) in crypto_report_one()
162 switch (alg->cra_flags & (CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_LARVAL)) { in crypto_report_one()
164 if (crypto_report_cipher(skb, alg)) in crypto_report_one()
169 if (crypto_report_comp(skb, alg)) in crypto_report_one()
175 if (crypto_report_akcipher(skb, alg)) in crypto_report_one()
188 static int crypto_report_alg(struct crypto_alg *alg, in crypto_report_alg() argument
206 err = crypto_report_one(alg, ualg, skb); in crypto_report_alg()
222 struct crypto_alg *alg; in crypto_report() local
230 alg = crypto_alg_match(p, 0); in crypto_report()
231 if (!alg) in crypto_report()
244 err = crypto_report_alg(alg, &info); in crypto_report()
247 crypto_mod_put(alg); in crypto_report()
257 struct crypto_alg *alg; in crypto_dump_report() local
271 list_for_each_entry(alg, &crypto_alg_list, cra_list) { in crypto_dump_report()
272 err = crypto_report_alg(alg, &info); in crypto_dump_report()
291 struct crypto_alg *alg; in crypto_update_alg() local
305 alg = crypto_alg_match(p, 1); in crypto_update_alg()
306 if (!alg) in crypto_update_alg()
311 crypto_remove_spawns(alg, &list, NULL); in crypto_update_alg()
314 alg->cra_priority = nla_get_u32(priority); in crypto_update_alg()
318 crypto_mod_put(alg); in crypto_update_alg()
327 struct crypto_alg *alg; in crypto_del_alg() local
337 alg = crypto_alg_match(p, 1); in crypto_del_alg()
338 if (!alg) in crypto_del_alg()
347 if (!(alg->cra_flags & CRYPTO_ALG_INSTANCE)) in crypto_del_alg()
351 if (atomic_read(&alg->cra_refcnt) > 2) in crypto_del_alg()
354 err = crypto_unregister_instance((struct crypto_instance *)alg); in crypto_del_alg()
357 crypto_mod_put(alg); in crypto_del_alg()
365 struct crypto_alg *alg; in crypto_user_skcipher_alg() local
371 alg = crypto_lookup_skcipher(name, type, mask); in crypto_user_skcipher_alg()
372 if (!IS_ERR(alg)) in crypto_user_skcipher_alg()
373 return alg; in crypto_user_skcipher_alg()
375 err = PTR_ERR(alg); in crypto_user_skcipher_alg()
392 struct crypto_alg *alg; in crypto_add_alg() local
408 alg = crypto_alg_match(p, exact); in crypto_add_alg()
409 if (alg) { in crypto_add_alg()
410 crypto_mod_put(alg); in crypto_add_alg()
423 alg = crypto_user_skcipher_alg(name, p->cru_type, p->cru_mask); in crypto_add_alg()
426 alg = crypto_alg_mod_lookup(name, p->cru_type, p->cru_mask); in crypto_add_alg()
429 if (IS_ERR(alg)) in crypto_add_alg()
430 return PTR_ERR(alg); in crypto_add_alg()
435 alg->cra_priority = nla_get_u32(priority); in crypto_add_alg()
439 crypto_mod_put(alg); in crypto_add_alg()
496 struct crypto_alg *alg; in crypto_user_rcv_msg() local
503 list_for_each_entry(alg, &crypto_alg_list, cra_list) in crypto_user_rcv_msg()