Lines Matching refs:alg

33 	struct crypto_alg *alg)  in __crypto_skcipher_alg()  argument
35 return container_of(alg, struct skcipher_alg, base); in __crypto_skcipher_alg()
42 struct skcipher_alg *alg; in skcipher_walk_virt() local
46 alg = crypto_skcipher_alg(tfm); in skcipher_walk_virt()
65 if (alg->co.base.cra_type != &crypto_skcipher_type) in skcipher_walk_virt()
66 walk->stride = alg->co.chunksize; in skcipher_walk_virt()
68 walk->stride = alg->walksize; in skcipher_walk_virt()
189 struct skcipher_alg *alg = crypto_skcipher_alg(tfm); in crypto_skcipher_encrypt() local
193 if (alg->co.base.cra_type != &crypto_skcipher_type) in crypto_skcipher_encrypt()
195 return alg->encrypt(req); in crypto_skcipher_encrypt()
202 struct skcipher_alg *alg = crypto_skcipher_alg(tfm); in crypto_skcipher_decrypt() local
206 if (alg->co.base.cra_type != &crypto_skcipher_type) in crypto_skcipher_decrypt()
208 return alg->decrypt(req); in crypto_skcipher_decrypt()
251 struct skcipher_alg *alg = crypto_skcipher_alg(tfm); in crypto_skcipher_export() local
253 if (alg->co.base.cra_type != &crypto_skcipher_type) in crypto_skcipher_export()
255 return alg->export(req, out); in crypto_skcipher_export()
262 struct skcipher_alg *alg = crypto_skcipher_alg(tfm); in crypto_skcipher_import() local
264 if (alg->co.base.cra_type != &crypto_skcipher_type) in crypto_skcipher_import()
266 return alg->import(req, in); in crypto_skcipher_import()
273 struct skcipher_alg *alg = crypto_skcipher_alg(skcipher); in crypto_skcipher_exit_tfm() local
275 alg->exit(skcipher); in crypto_skcipher_exit_tfm()
281 struct skcipher_alg *alg = crypto_skcipher_alg(skcipher); in crypto_skcipher_init_tfm() local
297 if (alg->exit) in crypto_skcipher_init_tfm()
300 if (alg->init) in crypto_skcipher_init_tfm()
301 return alg->init(skcipher); in crypto_skcipher_init_tfm()
306 static unsigned int crypto_skcipher_extsize(struct crypto_alg *alg) in crypto_skcipher_extsize() argument
308 if (alg->cra_type != &crypto_skcipher_type) in crypto_skcipher_extsize()
311 return crypto_alg_extsize(alg); in crypto_skcipher_extsize()
322 static void crypto_skcipher_show(struct seq_file *m, struct crypto_alg *alg)
324 static void crypto_skcipher_show(struct seq_file *m, struct crypto_alg *alg) in crypto_skcipher_show() argument
326 struct skcipher_alg *skcipher = __crypto_skcipher_alg(alg); in crypto_skcipher_show()
330 str_yes_no(alg->cra_flags & CRYPTO_ALG_ASYNC)); in crypto_skcipher_show()
331 seq_printf(m, "blocksize : %u\n", alg->cra_blocksize); in crypto_skcipher_show()
341 struct sk_buff *skb, struct crypto_alg *alg) in crypto_skcipher_report() argument
343 struct skcipher_alg *skcipher = __crypto_skcipher_alg(alg); in crypto_skcipher_report()
351 rblkcipher.blocksize = alg->cra_blocksize; in crypto_skcipher_report()
424 int skcipher_prepare_alg_common(struct skcipher_alg_common *alg) in skcipher_prepare_alg_common() argument
426 struct crypto_alg *base = &alg->base; in skcipher_prepare_alg_common()
428 if (alg->ivsize > PAGE_SIZE / 8 || alg->chunksize > PAGE_SIZE / 8 || in skcipher_prepare_alg_common()
429 alg->statesize > PAGE_SIZE / 2 || in skcipher_prepare_alg_common()
430 (alg->ivsize + alg->statesize) > PAGE_SIZE / 2) in skcipher_prepare_alg_common()
433 if (!alg->chunksize) in skcipher_prepare_alg_common()
434 alg->chunksize = base->cra_blocksize; in skcipher_prepare_alg_common()
441 static int skcipher_prepare_alg(struct skcipher_alg *alg) in skcipher_prepare_alg() argument
443 struct crypto_alg *base = &alg->base; in skcipher_prepare_alg()
446 err = skcipher_prepare_alg_common(&alg->co); in skcipher_prepare_alg()
450 if (alg->walksize > PAGE_SIZE / 8) in skcipher_prepare_alg()
453 if (!alg->walksize) in skcipher_prepare_alg()
454 alg->walksize = alg->chunksize; in skcipher_prepare_alg()
456 if (!alg->statesize) { in skcipher_prepare_alg()
457 alg->import = skcipher_noimport; in skcipher_prepare_alg()
458 alg->export = skcipher_noexport; in skcipher_prepare_alg()
459 } else if (!(alg->import && alg->export)) in skcipher_prepare_alg()
468 int crypto_register_skcipher(struct skcipher_alg *alg) in crypto_register_skcipher() argument
470 struct crypto_alg *base = &alg->base; in crypto_register_skcipher()
473 err = skcipher_prepare_alg(alg); in crypto_register_skcipher()
481 void crypto_unregister_skcipher(struct skcipher_alg *alg) in crypto_unregister_skcipher() argument
483 crypto_unregister_alg(&alg->base); in crypto_unregister_skcipher()
524 err = skcipher_prepare_alg(&inst->alg); in skcipher_register_instance()
619 inst->alg.base.cra_blocksize = cipher_alg->cra_blocksize; in skcipher_alloc_instance_simple()
620 inst->alg.base.cra_alignmask = cipher_alg->cra_alignmask; in skcipher_alloc_instance_simple()
621 inst->alg.base.cra_priority = cipher_alg->cra_priority; in skcipher_alloc_instance_simple()
622 inst->alg.min_keysize = cipher_alg->cra_cipher.cia_min_keysize; in skcipher_alloc_instance_simple()
623 inst->alg.max_keysize = cipher_alg->cra_cipher.cia_max_keysize; in skcipher_alloc_instance_simple()
624 inst->alg.ivsize = cipher_alg->cra_blocksize; in skcipher_alloc_instance_simple()
627 inst->alg.base.cra_ctxsize = sizeof(struct skcipher_ctx_simple); in skcipher_alloc_instance_simple()
628 inst->alg.setkey = skcipher_setkey_simple; in skcipher_alloc_instance_simple()
629 inst->alg.init = skcipher_init_tfm_simple; in skcipher_alloc_instance_simple()
630 inst->alg.exit = skcipher_exit_tfm_simple; in skcipher_alloc_instance_simple()