#include <crypto/internal/aead.h>
#include <crypto/internal/hash.h>
#include <crypto/internal/skcipher.h>
#include <crypto/authenc.h>
#include <crypto/scatterwalk.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/rtnetlink.h>
#include <linux/spinlock.h>
struct authenc_instance_ctx {
struct crypto_ahash_spawn auth;
struct crypto_skcipher_spawn enc;
struct crypto_authenc_ctx {
struct crypto_ahash *auth;
struct crypto_skcipher *enc;
struct crypto_sync_skcipher *null;
struct authenc_request_ctx {
struct scatterlist src[2];
struct scatterlist dst[2];
static void authenc_request_complete(struct aead_request *req, int err)
aead_request_complete(req, err);
int crypto_authenc_extractkeys(struct crypto_authenc_keys *keys, const u8 *key,
struct rtattr *rta = (struct rtattr *)key;
struct crypto_authenc_key_param *param;
if (!RTA_OK(rta, keylen))
if (rta->rta_type != CRYPTO_AUTHENC_KEYA_PARAM)
if (RTA_PAYLOAD(rta) != sizeof(*param))