/* * Software async crypto daemon. * * Copyright (c) 2006 Herbert Xu <herbert@gondor.apana.org.au> * * Added AEAD support to cryptd. * Authors: Tadeusz Struk (tadeusz.struk@intel.com) * Adrian Hoban <adrian.hoban@intel.com> * Gabriele Paoloni <gabriele.paoloni@intel.com> * Aidan O'Mahony (aidan.o.mahony@intel.com) * Copyright (c) 2010, Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * */#include<crypto/internal/hash.h>#include<crypto/internal/aead.h>#include<crypto/internal/skcipher.h>#include<crypto/cryptd.h>#include<crypto/crypto_wq.h>#include<linux/atomic.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>#define CRYPTD_MAX_CPU_QLEN 1000structcryptd_cpu_queue{structcrypto_queuequeue;structwork_structwork;};structcryptd_queue{structcryptd_cpu_queue__percpu*cpu_queue;};structcryptd_instance_ctx{structcrypto_spawnspawn;structcryptd_queue*queue;};structskcipherd_instance_ctx{structcrypto_skcipher_spawnspawn;structcryptd_queue*queue;};structhashd_instance_ctx{structcrypto_shash_spawnspawn;structcryptd_queue*queue;};structaead_instance_ctx{structcrypto_aead_spawnaead_spawn;structcryptd_queue*queue;};structcryptd_blkcipher_ctx{atomic_trefcnt;structcrypto_blkcipher*child;};structcryptd_blkcipher_request_ctx{crypto_completion_tcomplete;};structcryptd_skcipher_ctx{atomic_trefcnt;structcrypto_skcipher*child;};structcryptd_skcipher_request_ctx{crypto_completion_tcomplete;};structcryptd_hash_ctx{atomic_trefcnt;structcrypto_shash*child;};structcryptd_hash_request_ctx{crypto_completion_tcomplete;