#include <crypto/algapi.h>
#include <crypto/internal/skcipher.h>
#include <linux/kernel.h>
#include <linux/module.h>
static inline void crypto_cbc_encrypt_one(struct crypto_skcipher *tfm,
crypto_cipher_encrypt_one(skcipher_cipher_simple(tfm), dst, src);
static int crypto_cbc_encrypt(struct skcipher_request *req)
return crypto_cbc_encrypt_walk(req, crypto_cbc_encrypt_one);
static inline void crypto_cbc_decrypt_one(struct crypto_skcipher *tfm,
crypto_cipher_decrypt_one(skcipher_cipher_simple(tfm), dst, src);
static int crypto_cbc_decrypt(struct skcipher_request *req)
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
struct skcipher_walk walk;
err = skcipher_walk_virt(&walk, req, false);
err = crypto_cbc_decrypt_blocks(&walk, tfm,
err = skcipher_walk_done(&walk, err);
static int crypto_cbc_create(struct crypto_template *tmpl, struct rtattr **tb)
struct skcipher_instance *inst;
inst = skcipher_alloc_instance_simple(tmpl, tb, &alg);
if (!is_power_of_2(alg->cra_blocksize))