linux/drivers/crypto/virtio/virtio_crypto_skcipher_algs.c

// SPDX-License-Identifier: GPL-2.0-or-later
 /* Algorithms supported by virtio crypto device
  *
  * Authors: Gonglei <[email protected]>
  *
  * Copyright 2016 HUAWEI TECHNOLOGIES CO., LTD.
  */

#include <crypto/engine.h>
#include <crypto/internal/skcipher.h>
#include <crypto/scatterwalk.h>
#include <linux/err.h>
#include <linux/scatterlist.h>
#include <uapi/linux/virtio_crypto.h>
#include "virtio_crypto_common.h"


struct virtio_crypto_skcipher_ctx {};

struct virtio_crypto_sym_request {};

struct virtio_crypto_algo {};

/*
 * The algs_lock protects the below global virtio_crypto_active_devs
 * and crypto algorithms registion.
 */
static DEFINE_MUTEX(algs_lock);
static void virtio_crypto_skcipher_finalize_req(
	struct virtio_crypto_sym_request *vc_sym_req,
	struct skcipher_request *req,
	int err);

static void virtio_crypto_dataq_sym_callback
		(struct virtio_crypto_request *vc_req, int len)
{}

static u64 virtio_crypto_alg_sg_nents_length(struct scatterlist *sg)
{}

static int
virtio_crypto_alg_validate_key(int key_len, uint32_t *alg)
{}

static int virtio_crypto_alg_skcipher_init_session(
		struct virtio_crypto_skcipher_ctx *ctx,
		uint32_t alg, const uint8_t *key,
		unsigned int keylen,
		int encrypt)
{}

static int virtio_crypto_alg_skcipher_close_session(
		struct virtio_crypto_skcipher_ctx *ctx,
		int encrypt)
{}

static int virtio_crypto_alg_skcipher_init_sessions(
		struct virtio_crypto_skcipher_ctx *ctx,
		const uint8_t *key, unsigned int keylen)
{}

/* Note: kernel crypto API realization */
static int virtio_crypto_skcipher_setkey(struct crypto_skcipher *tfm,
					 const uint8_t *key,
					 unsigned int keylen)
{}

static int
__virtio_crypto_skcipher_do_req(struct virtio_crypto_sym_request *vc_sym_req,
		struct skcipher_request *req,
		struct data_queue *data_vq)
{}

static int virtio_crypto_skcipher_encrypt(struct skcipher_request *req)
{}

static int virtio_crypto_skcipher_decrypt(struct skcipher_request *req)
{}

static int virtio_crypto_skcipher_init(struct crypto_skcipher *tfm)
{}

static void virtio_crypto_skcipher_exit(struct crypto_skcipher *tfm)
{}

int virtio_crypto_skcipher_crypt_req(
	struct crypto_engine *engine, void *vreq)
{}

static void virtio_crypto_skcipher_finalize_req(
	struct virtio_crypto_sym_request *vc_sym_req,
	struct skcipher_request *req,
	int err)
{}

static struct virtio_crypto_algo virtio_crypto_algs[] =;

int virtio_crypto_skcipher_algs_register(struct virtio_crypto *vcrypto)
{}

void virtio_crypto_skcipher_algs_unregister(struct virtio_crypto *vcrypto)
{}