Lines Matching full: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
299 if (alg->exit) in crypto_skcipher_init_tfm()
302 if (alg->init) in crypto_skcipher_init_tfm()
303 return alg->init(skcipher); in crypto_skcipher_init_tfm()
308 static unsigned int crypto_skcipher_extsize(struct crypto_alg *alg) in crypto_skcipher_extsize() argument
310 if (alg->cra_type != &crypto_skcipher_type) in crypto_skcipher_extsize()
313 return crypto_alg_extsize(alg); in crypto_skcipher_extsize()
324 static void crypto_skcipher_show(struct seq_file *m, struct crypto_alg *alg)
326 static void crypto_skcipher_show(struct seq_file *m, struct crypto_alg *alg) in crypto_skcipher_show() argument
328 struct skcipher_alg *skcipher = __crypto_skcipher_alg(alg); in crypto_skcipher_show()
332 str_yes_no(alg->cra_flags & CRYPTO_ALG_ASYNC)); in crypto_skcipher_show()
333 seq_printf(m, "blocksize : %u\n", alg->cra_blocksize); in crypto_skcipher_show()
343 struct sk_buff *skb, struct crypto_alg *alg) in crypto_skcipher_report() argument
345 struct skcipher_alg *skcipher = __crypto_skcipher_alg(alg); in crypto_skcipher_report()
353 rblkcipher.blocksize = alg->cra_blocksize; in crypto_skcipher_report()
426 int skcipher_prepare_alg_common(struct skcipher_alg_common *alg) in skcipher_prepare_alg_common() argument
428 struct crypto_alg *base = &alg->base; in skcipher_prepare_alg_common()
430 if (alg->ivsize > PAGE_SIZE / 8 || alg->chunksize > PAGE_SIZE / 8 || in skcipher_prepare_alg_common()
431 alg->statesize > PAGE_SIZE / 2 || in skcipher_prepare_alg_common()
432 (alg->ivsize + alg->statesize) > PAGE_SIZE / 2) in skcipher_prepare_alg_common()
435 if (!alg->chunksize) in skcipher_prepare_alg_common()
436 alg->chunksize = base->cra_blocksize; in skcipher_prepare_alg_common()
443 static int skcipher_prepare_alg(struct skcipher_alg *alg) in skcipher_prepare_alg() argument
445 struct crypto_alg *base = &alg->base; in skcipher_prepare_alg()
448 err = skcipher_prepare_alg_common(&alg->co); in skcipher_prepare_alg()
452 if (alg->walksize > PAGE_SIZE / 8) in skcipher_prepare_alg()
455 if (!alg->walksize) in skcipher_prepare_alg()
456 alg->walksize = alg->chunksize; in skcipher_prepare_alg()
458 if (!alg->statesize) { in skcipher_prepare_alg()
459 alg->import = skcipher_noimport; in skcipher_prepare_alg()
460 alg->export = skcipher_noexport; in skcipher_prepare_alg()
461 } else if (!(alg->import && alg->export)) in skcipher_prepare_alg()
470 int crypto_register_skcipher(struct skcipher_alg *alg) in crypto_register_skcipher() argument
472 struct crypto_alg *base = &alg->base; in crypto_register_skcipher()
475 err = skcipher_prepare_alg(alg); in crypto_register_skcipher()
483 void crypto_unregister_skcipher(struct skcipher_alg *alg) in crypto_unregister_skcipher() argument
485 crypto_unregister_alg(&alg->base); in crypto_unregister_skcipher()
526 err = skcipher_prepare_alg(&inst->alg); in skcipher_register_instance()
621 inst->alg.base.cra_blocksize = cipher_alg->cra_blocksize; in skcipher_alloc_instance_simple()
622 inst->alg.base.cra_alignmask = cipher_alg->cra_alignmask; in skcipher_alloc_instance_simple()
623 inst->alg.base.cra_priority = cipher_alg->cra_priority; in skcipher_alloc_instance_simple()
624 inst->alg.min_keysize = cipher_alg->cra_cipher.cia_min_keysize; in skcipher_alloc_instance_simple()
625 inst->alg.max_keysize = cipher_alg->cra_cipher.cia_max_keysize; in skcipher_alloc_instance_simple()
626 inst->alg.ivsize = cipher_alg->cra_blocksize; in skcipher_alloc_instance_simple()
629 inst->alg.base.cra_ctxsize = sizeof(struct skcipher_ctx_simple); in skcipher_alloc_instance_simple()
630 inst->alg.setkey = skcipher_setkey_simple; in skcipher_alloc_instance_simple()
631 inst->alg.init = skcipher_init_tfm_simple; in skcipher_alloc_instance_simple()
632 inst->alg.exit = skcipher_exit_tfm_simple; in skcipher_alloc_instance_simple()