#include <crypto/internal/hash.h>
#include <crypto/internal/aead.h>
#include <crypto/internal/skcipher.h>
#include <crypto/cryptd.h>
#include <linux/refcount.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/scatterlist.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
static unsigned int cryptd_max_cpu_qlen = …;
module_param(cryptd_max_cpu_qlen, uint, 0);
MODULE_PARM_DESC(…) …;
static struct workqueue_struct *cryptd_wq;
struct cryptd_cpu_queue { … };
struct cryptd_queue { … };
struct cryptd_instance_ctx { … };
struct skcipherd_instance_ctx { … };
struct hashd_instance_ctx { … };
struct aead_instance_ctx { … };
struct cryptd_skcipher_ctx { … };
struct cryptd_skcipher_request_ctx { … };
struct cryptd_hash_ctx { … };
struct cryptd_hash_request_ctx { … };
struct cryptd_aead_ctx { … };
struct cryptd_aead_request_ctx { … };
static void cryptd_queue_worker(struct work_struct *work);
static int cryptd_init_queue(struct cryptd_queue *queue,
unsigned int max_cpu_qlen)
{ … }
static void cryptd_fini_queue(struct cryptd_queue *queue)
{ … }
static int cryptd_enqueue_request(struct cryptd_queue *queue,
struct crypto_async_request *request)
{ … }
static void cryptd_queue_worker(struct work_struct *work)
{ … }
static inline struct cryptd_queue *cryptd_get_queue(struct crypto_tfm *tfm)
{ … }
static void cryptd_type_and_mask(struct crypto_attr_type *algt,
u32 *type, u32 *mask)
{ … }
static int cryptd_init_instance(struct crypto_instance *inst,
struct crypto_alg *alg)
{ … }
static int cryptd_skcipher_setkey(struct crypto_skcipher *parent,
const u8 *key, unsigned int keylen)
{ … }
static struct skcipher_request *cryptd_skcipher_prepare(
struct skcipher_request *req, int err)
{ … }
static void cryptd_skcipher_complete(struct skcipher_request *req, int err,
crypto_completion_t complete)
{ … }
static void cryptd_skcipher_encrypt(void *data, int err)
{ … }
static void cryptd_skcipher_decrypt(void *data, int err)
{ … }
static int cryptd_skcipher_enqueue(struct skcipher_request *req,
crypto_completion_t compl)
{ … }
static int cryptd_skcipher_encrypt_enqueue(struct skcipher_request *req)
{ … }
static int cryptd_skcipher_decrypt_enqueue(struct skcipher_request *req)
{ … }
static int cryptd_skcipher_init_tfm(struct crypto_skcipher *tfm)
{ … }
static void cryptd_skcipher_exit_tfm(struct crypto_skcipher *tfm)
{ … }
static void cryptd_skcipher_free(struct skcipher_instance *inst)
{ … }
static int cryptd_create_skcipher(struct crypto_template *tmpl,
struct rtattr **tb,
struct crypto_attr_type *algt,
struct cryptd_queue *queue)
{ … }
static int cryptd_hash_init_tfm(struct crypto_ahash *tfm)
{ … }
static int cryptd_hash_clone_tfm(struct crypto_ahash *ntfm,
struct crypto_ahash *tfm)
{ … }
static void cryptd_hash_exit_tfm(struct crypto_ahash *tfm)
{ … }
static int cryptd_hash_setkey(struct crypto_ahash *parent,
const u8 *key, unsigned int keylen)
{ … }
static int cryptd_hash_enqueue(struct ahash_request *req,
crypto_completion_t compl)
{ … }
static struct shash_desc *cryptd_hash_prepare(struct ahash_request *req,
int err)
{ … }
static void cryptd_hash_complete(struct ahash_request *req, int err,
crypto_completion_t complete)
{ … }
static void cryptd_hash_init(void *data, int err)
{ … }
static int cryptd_hash_init_enqueue(struct ahash_request *req)
{ … }
static void cryptd_hash_update(void *data, int err)
{ … }
static int cryptd_hash_update_enqueue(struct ahash_request *req)
{ … }
static void cryptd_hash_final(void *data, int err)
{ … }
static int cryptd_hash_final_enqueue(struct ahash_request *req)
{ … }
static void cryptd_hash_finup(void *data, int err)
{ … }
static int cryptd_hash_finup_enqueue(struct ahash_request *req)
{ … }
static void cryptd_hash_digest(void *data, int err)
{ … }
static int cryptd_hash_digest_enqueue(struct ahash_request *req)
{ … }
static int cryptd_hash_export(struct ahash_request *req, void *out)
{ … }
static int cryptd_hash_import(struct ahash_request *req, const void *in)
{ … }
static void cryptd_hash_free(struct ahash_instance *inst)
{ … }
static int cryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb,
struct crypto_attr_type *algt,
struct cryptd_queue *queue)
{ … }
static int cryptd_aead_setkey(struct crypto_aead *parent,
const u8 *key, unsigned int keylen)
{ … }
static int cryptd_aead_setauthsize(struct crypto_aead *parent,
unsigned int authsize)
{ … }
static void cryptd_aead_crypt(struct aead_request *req,
struct crypto_aead *child, int err,
int (*crypt)(struct aead_request *req),
crypto_completion_t compl)
{ … }
static void cryptd_aead_encrypt(void *data, int err)
{ … }
static void cryptd_aead_decrypt(void *data, int err)
{ … }
static int cryptd_aead_enqueue(struct aead_request *req,
crypto_completion_t compl)
{ … }
static int cryptd_aead_encrypt_enqueue(struct aead_request *req)
{ … }
static int cryptd_aead_decrypt_enqueue(struct aead_request *req)
{ … }
static int cryptd_aead_init_tfm(struct crypto_aead *tfm)
{ … }
static void cryptd_aead_exit_tfm(struct crypto_aead *tfm)
{ … }
static void cryptd_aead_free(struct aead_instance *inst)
{ … }
static int cryptd_create_aead(struct crypto_template *tmpl,
struct rtattr **tb,
struct crypto_attr_type *algt,
struct cryptd_queue *queue)
{ … }
static struct cryptd_queue queue;
static int cryptd_create(struct crypto_template *tmpl, struct rtattr **tb)
{ … }
static struct crypto_template cryptd_tmpl = …;
struct cryptd_skcipher *cryptd_alloc_skcipher(const char *alg_name,
u32 type, u32 mask)
{ … }
EXPORT_SYMBOL_GPL(…);
struct crypto_skcipher *cryptd_skcipher_child(struct cryptd_skcipher *tfm)
{ … }
EXPORT_SYMBOL_GPL(…);
bool cryptd_skcipher_queued(struct cryptd_skcipher *tfm)
{ … }
EXPORT_SYMBOL_GPL(…);
void cryptd_free_skcipher(struct cryptd_skcipher *tfm)
{ … }
EXPORT_SYMBOL_GPL(…);
struct cryptd_ahash *cryptd_alloc_ahash(const char *alg_name,
u32 type, u32 mask)
{ … }
EXPORT_SYMBOL_GPL(…);
struct crypto_shash *cryptd_ahash_child(struct cryptd_ahash *tfm)
{ … }
EXPORT_SYMBOL_GPL(…);
struct shash_desc *cryptd_shash_desc(struct ahash_request *req)
{ … }
EXPORT_SYMBOL_GPL(…);
bool cryptd_ahash_queued(struct cryptd_ahash *tfm)
{ … }
EXPORT_SYMBOL_GPL(…);
void cryptd_free_ahash(struct cryptd_ahash *tfm)
{ … }
EXPORT_SYMBOL_GPL(…);
struct cryptd_aead *cryptd_alloc_aead(const char *alg_name,
u32 type, u32 mask)
{ … }
EXPORT_SYMBOL_GPL(…);
struct crypto_aead *cryptd_aead_child(struct cryptd_aead *tfm)
{ … }
EXPORT_SYMBOL_GPL(…);
bool cryptd_aead_queued(struct cryptd_aead *tfm)
{ … }
EXPORT_SYMBOL_GPL(…);
void cryptd_free_aead(struct cryptd_aead *tfm)
{ … }
EXPORT_SYMBOL_GPL(…);
static int __init cryptd_init(void)
{ … }
static void __exit cryptd_exit(void)
{ … }
subsys_initcall(cryptd_init);
module_exit(cryptd_exit);
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_ALIAS_CRYPTO(…) …;