Lines Matching refs:alg

49 	struct crypto_alg *q, *alg = NULL;  in crypto_alg_match()  local
71 alg = q; in crypto_alg_match()
77 return alg; in crypto_alg_match()
80 static int crypto_report_cipher(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_cipher() argument
86 rcipher.blocksize = alg->cra_blocksize; in crypto_report_cipher()
87 rcipher.min_keysize = alg->cra_cipher.cia_min_keysize; in crypto_report_cipher()
88 rcipher.max_keysize = alg->cra_cipher.cia_max_keysize; in crypto_report_cipher()
99 static int crypto_report_comp(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_comp() argument
113 static int crypto_report_one(struct crypto_alg *alg, in crypto_report_one() argument
116 strncpy(ualg->cru_name, alg->cra_name, sizeof(ualg->cru_name)); in crypto_report_one()
117 strncpy(ualg->cru_driver_name, alg->cra_driver_name, in crypto_report_one()
119 strncpy(ualg->cru_module_name, module_name(alg->cra_module), in crypto_report_one()
124 ualg->cru_flags = alg->cra_flags; in crypto_report_one()
125 ualg->cru_refcnt = atomic_read(&alg->cra_refcnt); in crypto_report_one()
127 if (nla_put_u32(skb, CRYPTOCFGA_PRIORITY_VAL, alg->cra_priority)) in crypto_report_one()
129 if (alg->cra_flags & CRYPTO_ALG_LARVAL) { in crypto_report_one()
139 if (alg->cra_type && alg->cra_type->report) { in crypto_report_one()
140 if (alg->cra_type->report(skb, alg)) in crypto_report_one()
146 switch (alg->cra_flags & (CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_LARVAL)) { in crypto_report_one()
148 if (crypto_report_cipher(skb, alg)) in crypto_report_one()
153 if (crypto_report_comp(skb, alg)) in crypto_report_one()
166 static int crypto_report_alg(struct crypto_alg *alg, in crypto_report_alg() argument
184 err = crypto_report_one(alg, ualg, skb); in crypto_report_alg()
200 struct crypto_alg *alg; in crypto_report() local
208 alg = crypto_alg_match(p, 0); in crypto_report()
209 if (!alg) in crypto_report()
222 err = crypto_report_alg(alg, &info); in crypto_report()
225 crypto_mod_put(alg); in crypto_report()
235 struct crypto_alg *alg; in crypto_dump_report() local
249 list_for_each_entry(alg, &crypto_alg_list, cra_list) { in crypto_dump_report()
250 err = crypto_report_alg(alg, &info); in crypto_dump_report()
269 struct crypto_alg *alg; in crypto_update_alg() local
283 alg = crypto_alg_match(p, 1); in crypto_update_alg()
284 if (!alg) in crypto_update_alg()
289 crypto_remove_spawns(alg, &list, NULL); in crypto_update_alg()
292 alg->cra_priority = nla_get_u32(priority); in crypto_update_alg()
296 crypto_mod_put(alg); in crypto_update_alg()
305 struct crypto_alg *alg; in crypto_del_alg() local
315 alg = crypto_alg_match(p, 1); in crypto_del_alg()
316 if (!alg) in crypto_del_alg()
325 if (!(alg->cra_flags & CRYPTO_ALG_INSTANCE)) in crypto_del_alg()
329 if (atomic_read(&alg->cra_refcnt) > 2) in crypto_del_alg()
332 err = crypto_unregister_instance((struct crypto_instance *)alg); in crypto_del_alg()
335 crypto_mod_put(alg); in crypto_del_alg()
343 struct crypto_alg *alg; in crypto_user_skcipher_alg() local
349 alg = crypto_lookup_skcipher(name, type, mask); in crypto_user_skcipher_alg()
350 if (!IS_ERR(alg)) in crypto_user_skcipher_alg()
351 return alg; in crypto_user_skcipher_alg()
353 err = PTR_ERR(alg); in crypto_user_skcipher_alg()
369 struct crypto_alg *alg; in crypto_user_aead_alg() local
377 alg = crypto_lookup_aead(name, type, mask); in crypto_user_aead_alg()
378 if (!IS_ERR(alg)) in crypto_user_aead_alg()
379 return alg; in crypto_user_aead_alg()
381 err = PTR_ERR(alg); in crypto_user_aead_alg()
398 struct crypto_alg *alg; in crypto_add_alg() local
414 alg = crypto_alg_match(p, exact); in crypto_add_alg()
415 if (alg) { in crypto_add_alg()
416 crypto_mod_put(alg); in crypto_add_alg()
427 alg = crypto_user_aead_alg(name, p->cru_type, p->cru_mask); in crypto_add_alg()
432 alg = crypto_user_skcipher_alg(name, p->cru_type, p->cru_mask); in crypto_add_alg()
435 alg = crypto_alg_mod_lookup(name, p->cru_type, p->cru_mask); in crypto_add_alg()
438 if (IS_ERR(alg)) in crypto_add_alg()
439 return PTR_ERR(alg); in crypto_add_alg()
444 alg->cra_priority = nla_get_u32(priority); in crypto_add_alg()
448 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()