17 #include <linux/kernel.h>
18 #include <linux/module.h>
19 #include <linux/slab.h>
34 crypto_blkcipher_set_flags(child, crypto_tfm_get_flags(parent) &
36 err = crypto_blkcipher_setkey(child, key, keylen);
37 crypto_tfm_set_flags(parent, crypto_blkcipher_get_flags(child) &
51 .info = desc_in->
info,
56 err = crypto_blkcipher_crt(desc.
tfm)->encrypt(&desc, dst, src, nbytes);
70 .info = desc_in->
info,
75 err = crypto_blkcipher_crt(desc.
tfm)->decrypt(&desc, dst, src, nbytes);
87 cipher = crypto_spawn_blkcipher(spawn);
89 return PTR_ERR(cipher);
95 static void crypto_fpu_exit_tfm(
struct crypto_tfm *tfm)
98 crypto_free_blkcipher(ctx->
child);
114 return ERR_CAST(alg);
125 inst->
alg.cra_blkcipher.ivsize = alg->cra_blkcipher.ivsize;
126 inst->
alg.cra_blkcipher.min_keysize = alg->cra_blkcipher.min_keysize;
127 inst->
alg.cra_blkcipher.max_keysize = alg->cra_blkcipher.max_keysize;
129 inst->
alg.cra_init = crypto_fpu_init_tfm;
130 inst->
alg.cra_exit = crypto_fpu_exit_tfm;
131 inst->
alg.cra_blkcipher.setkey = crypto_fpu_setkey;
132 inst->
alg.cra_blkcipher.encrypt = crypto_fpu_encrypt;
133 inst->
alg.cra_blkcipher.decrypt = crypto_fpu_decrypt;
148 .alloc = crypto_fpu_alloc,
149 .free = crypto_fpu_free,